-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from lemaslab/xinsong
add unknown search
- Loading branch information
Showing
9 changed files
with
222 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Test processes after MZmine with sample data | ||
./nextflow run_aftermzmine.nf --input_dir_pos .travis/data/POS/ --input_dir_neg .travis/data/NEG --POS_design_path .travis/pos_design.csv --NEG_design_path .travis/neg_design.csv --cutoff 1 --pos_mzmine_peak_output .travis/pos_data.csv --neg_mzmine_peak_output .travis/neg_data.csv -with-docker galaxydream/metabolomics_pipeline | ||
# Test processes MZmine output files with sample data | ||
./nextflow run_aftermzmine.nf --input_dir_pos .travis/data/POS/ --input_dir_neg .travis/data/NEG --POS_design_path .travis/pos_design.csv --NEG_design_path .travis/neg_design.csv --cutoff 1 --pos_mzmine_peak_output .travis/pos_data.csv --neg_mzmine_peak_output .travis/neg_data.csv -with-docker xinsongdu/lemaslab_rump:v1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Dockerfile for UMPIRE | ||
# Dockerfile for RUMP | ||
|
||
FROM rocker/r-ver:3.5.2 | ||
FROM rocker/rstudio:3.6.3 | ||
|
||
MAINTAINER [email protected] | ||
|
||
|
@@ -58,7 +58,11 @@ WORKDIR /app | |
COPY accessibility.properties /app | ||
|
||
# Fix a bug for java | ||
RUN mv accessibility.properties /etc/java-8-openjdk/ | ||
# RUN mv accessibility.properties /etc/java-8-openjdk/ | ||
|
||
# install R packages | ||
COPY r_package_install.R /app | ||
RUN Rscript r_package_install.R | ||
|
||
# Install mummichog | ||
RUN pip install --upgrade setuptools | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# install neccessary packages | ||
list.of.packages <- c("cmmr", "optparse") | ||
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] | ||
if(length(new.packages)) install.packages(new.packages) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 2018.12.19. ask | ||
# rm(list=ls(all=TRUE)) | ||
|
||
# 20 Digits Precision Representation | ||
options(scipen=20) | ||
|
||
# Setting the correct working directory. | ||
# NOTE!!! -> Can be linked differently on different computers. | ||
# setwd("/Users/xinsongdu/mnt/projects/beach01/secimtools") | ||
|
||
library(optparse) # add this library to enable argparse arguments | ||
library(cmmr) | ||
options(warn=-1) | ||
|
||
## Define input and output arguments | ||
option_list = list( | ||
make_option(c("-i", "--input"), type="character", default="bovine_enriched_unknown.csv", | ||
help="input data file"), | ||
make_option(c("-c", "--mz_col"), type="character", default="row.m.z", | ||
help="column name indicating m/z values"), | ||
make_option(c("-n", "--ion"), type="character", default="positive", | ||
help="ion mode"), | ||
make_option(c("-o", "--output"), type="character", default="searched_unknown_pos_after_blank_subtraction.csv", | ||
help="output csv file name") | ||
); | ||
|
||
opt_parser = OptionParser(option_list=option_list); | ||
opt = parse_args(opt_parser); | ||
|
||
# read data | ||
data <- read.csv(file=opt$input) | ||
|
||
# extract mz values from data | ||
mzs = as.vector(data[['row.m.z']]) | ||
# mzs = lapply(mzs,round,4) | ||
|
||
if (opt$ion=="negative"){ | ||
adduct <- '["M-H"]' | ||
} else { | ||
adduct <- '["M+H"]' | ||
} | ||
|
||
# batch search | ||
batch_df <- batch_search('http://ceumass.eps.uspceu.es/mediator/api/v3/batch', | ||
'all-except-peptides', | ||
'["all-except-mine"]', | ||
'mz', | ||
opt$ion, | ||
adduct, | ||
5, | ||
'ppm', | ||
mzs) | ||
if (typeof(batch_df)=="character"){ | ||
data_merge <- data.frame(Empty=character()) | ||
} else { | ||
data_merge <- merge(data, batch_df, by.x='row.m.z', by.y='experimental_mass') | ||
} | ||
|
||
write.csv(data_merge, opt$output, row.names=TRUE) |
Oops, something went wrong.