Code Monkey home page Code Monkey logo

qc4metabolomics's Introduction

QC4metabolomics

QC systems for metabolomics studies

Installation

WIP. You won't get very far at the moment...

  • Run QC system on another computer

Folder moving

Optional

Purpose

To move files from an instrument computer to another location as soon as an analytical run is finished (e.g. a network drive). This way you don't need to run the whole QC system on the instrument computer. These scripts are written for Waters' raw folder and should not be used directly for anything else.

What the scripts are meant to do:

  • Monitor when a run is done.
  • Will check if the filename (really a folder name) has the expected number of delimiters.
  • If the filename is in the right format the file will be move to the given location. This script was written for the metabolomics group at NEXS and there are therefore specific parsing of the filename to decide the destination folder.
    • The first string before the first delimiter is used as the project name and a project folder is create such that the file %infolder%\test-pro_pos_test-sample-metstd.raw will be moved to %outfolder%\test-pro.raw\Data\test-pro_pos_test-sample-metstd.raw
  • Optionally symlinks can be made from the original location to the destination folder. This way you can still access the file as if it was still in the original place even if it is actually access in the destination location. So you can open the file normally in the instrument software that expect the file to exist at the original location.
  • Optionally the above mentioned symlinks can be cleared my running a script.

Usage

  • Copy the content of file_mover to the instrument computer where the files are located.

  • Edit the top part of win_waters_mover.bat to point to the right folders and the settings you want.

    • infolder and outfolder are the source and destination folders respectively.
    • Like the QC system the file move expect to be able to parse information from the file name. So delim sets the character that separates the information.
    • expect_delims stats how many delimiters to expect in a filename. This is used to only parse files with the expected filename convention.
    • If symlinkback is TRUE a symbolic link will be made in the original location pointing to the destination location.
  • If you use symlinks you need to:

    • Right click on Start → Run and launch "secpol.msc".
    • Open "Security Settings" → "Local Policies" → "User Rights Assignment" and select "Create symbolic links".
    • Click "Add User or Group..." → enter the username the system normally uses → click "Check Names" → Click "OK" → Click "OK"
    • Reboot or log out and log in again (or run "gpupdate/force" on the command-line as administrator).
  • Edit monitor_folder.bat to point to the same input folder as in win_waters_mover.bat.

  • Run enable_monitor_at_startup.bat. This should make the folder monitor start at reboot. A console windows will be visible if this worked (after reboot).

  • If you used symlinks you can always remove all symlinks by running clear_symlink_folders.bat. Edit to set the location first. This should be same location as infolder in win_waters_mover.bat.

qc4metabolomics's People

Contributors

stanstrup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qc4metabolomics's Issues

Faster pulling of contaminant data

Need to check of it does now but it should do some filtering on the sql side.
Like

  • Only entres above the min setting --> get unique compounds
  • pull only those compounds

No way to install the MetabolomiQCsR package (massageR is missing)

I am trying to install MetabolomiQCsR in R 3.4.4 in the following way:

devtools::install_github('stanstrup/QC4Metabolomics/MetabolomiQCsR')

I get an error stating that massageR is missing.

ERROR: dependency 'massageR' is not available for package 'MetabolomiQCsR'

I cannot find massageR anywhere.

Shiny scheduler

DB with last script run time --> run script every X minutes. Need to be able to execute the script without waiting for results.

Trouble setting up the Shiny app and MySQL database

Sorry for the elementary question, but I am not very familiar with MySQL and I cannot figure out how to run the Shiny application.

I believe I am not properly setting up the MySQL connection so the culprit is there. I would really appreciate any feedback to help me understand what I am doing wrong here.

I receive this error:

Warning: Error in .local: could not run statement: Table 'metabolomicsSQLDB.std_compounds' doesn't exist
Warning: Error in .local: could not run statement: Table 'metabolomicsSQLDB.file_info' doesn't exist
Error in .local(conn, statement, ...) :
could not run statement: Table 'metabolomicsSQLDB.std_compounds' doesn't exist
Warning: Error in .local: could not run statement: Table 'metabolomicsSQLDB.file_info' doesn't exist

These are the steps I have taken to set up the Shiny app:

First, in Ubuntu terminal.

$ sudo /etc/init.d/mysql start
$ sudo /usr/bin/mysql -u root -p
    mysql> CREATE DATABASE metabolomicsSQLDB;
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'R_user'@'localhost' IDENTIFIED BY 'pass1234';

Then, in RStudio.

devtools::install_git("https://gitlab.com/R_packages/massageR.git")
devtools::install_github("stanstrup/QC4Metabolomics/MetabolomiQCsR")
system('wget https://github.com/stanstrup/QC4Metabolomics/archive/master.zip')
system('unzip master.zip; rm master.zip')
MetabolomiQCsR.env$db$db <- "metabolomicsSQLDB"
MetabolomiQCsR.env$db$user <- "R_user"
MetabolomiQCsR.env$db$password <- "pass1234"
MetabolomiQCsR.env$db$host <- "127.0.0.1"
runApp(appDir = "QC4Metabolomics-master/Shiny App/", launch.browser = T)

Am I missing something? Thanks.

Vendor format to converted files on server

  • automatic msconvert (Proteowizard I suppose? Double check). Batch script on a schedule? File monitor?
  • Automatic copy of converted file.
  • copy sample name and project name from samplelist name from the raw data.

Control panel

Settings app

  • move settings in a separate app that can always run




Control panel that can

  • reschedule all files
  • reschedule selected files
  • reevaluate identical files --> refer to the ones that still exist
  • prune missing files

Better contaminant pic

  • do one line per sample. not per date. the put the days where they need to be.
  • make it long enough to read all contaminant names

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.