# HG changeset patch # User taoufikbens # Date 1470149658 14400 # Node ID b2d176fbe14242465e9941d6ea3e4979eccbd567 Uploaded diff -r 000000000000 -r b2d176fbe142 digestion.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/digestion.R Tue Aug 02 10:54:18 2016 -0400 @@ -0,0 +1,58 @@ +#Rscript --vanilla --slave --no-site-file , Rscript version installed from toolshed with the dependencies +# xcms.r version="20150519" + +#Redirect all stdout to the log file +#Out prints redirected to a log file +log_file=file("peptidesearch.log", open = "wt") +sink(log_file) +sink(log_file, type = "out") +#Loading needed librairies xcms for the GC-LCMS preprocessing +#For args parsing we load parseCommandArgs function from batch package +library(batch) +library("cleaver") +library("BRAIN") +#library("animation") +#Function reconstructing the source path of the data by using passed arguments to the script +#Keeps just the arguments after --file +#Parsing argumets passed to the script +source_local <- function(fname){ + # + argv <- commandArgs(trailingOnly = FALSE) + base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) + source(paste(base_dir, fname, sep="/")) +} +#interpretation of arguments given in command line as an R list of objects +listArguments = parseCommandArgs(evaluate=FALSE) +print(listArguments) +sequence=listArguments[["sequence"]] +pepway=listArguments[["pepway"]] +missedCleavages=as.numeric(listArguments[["missedCleavages"]]) +enzym=listArguments[["enzym"]] +peptidename="Manual Peptide" +if(pepway=="byid"){ + #Peptide id + peptideid=sequence + #Cleavage Enzym + #enzym="trypsin" + #Number of missed cleavage + #missedCleavages=c(1) + #Uniprot static url access + urluniprot="http://www.uniprot.org/uniprot/" + #Url for the fasta sequence + urlseq=paste(urluniprot,peptideid,".fasta",sep = "") + #Getting the content of the url (fasta) + reponsefasta=readLines(urlseq) + taille=length(reponsefasta) + sequencearray=reponsefasta[2:taille] + #Extracting sequence from fasta file + sequence=paste(sequencearray, collapse = '') + sequence=paste(strsplit(sequence,split = "\n")[[1]],collapse = "") + spp=strsplit(reponsefasta[1]," ") + peptidename=spp[[1]][1] +} +peptidedigested=cleave(sequence,enzym=enzym)[[1]] +print("Result of the digestion") +for(i in seq(1:length(peptidedigested))){ + print(peptidedigested[i]) + +} diff -r 000000000000 -r b2d176fbe142 digestion.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/digestion.xml Tue Aug 02 10:54:18 2016 -0400 @@ -0,0 +1,77 @@ + + + Simulate peptides digestion. + + peptidesearch.r + enzym $enzym missedCleavages $missedCleavages + #if $pepsequence.source_select=="bysequence" + pepway "bysequence" sequence $pepsequence.sequence + #else + pepway "byid" sequence $pepsequence.pepid + #end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +