# HG changeset patch # User tomnl # Date 1531908392 14400 # Node ID 78885fff83a3f6483ceda5482b9d86d0e9c000b6 # Parent 49e0630706475814c88981f91045d718804f1fb0 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 1800a3818988f21ef129e500818c9a087fce5875 diff -r 49e063070647 -r 78885fff83a3 create_msp.R --- a/create_msp.R Tue Jul 17 12:30:24 2018 -0400 +++ b/create_msp.R Wed Jul 18 06:06:32 2018 -0400 @@ -21,11 +21,11 @@ +#grped_df$fileid <- sapply(grped_df$filename, function(x) which(basename(pa@fileList)==x)) +#puritydf$fileid <- sapply(puritydf$filename, function(x) which(basename(pa@fileList)==x)) -grped_df$fileid <- sapply(grped_df$filename, function(x) which(basename(pa@fileList)==x)) -puritydf$fileid <- sapply(puritydf$filename, function(x) which(basename(pa@fileList)==x)) selfrag <- as.numeric(unique(grped_df$grpid)) @@ -66,9 +66,15 @@ specj <- spec[[jj]] - grpdj <- grpd[jj,] + - name = paste(i, grpdj$sample, grpdj$pid, sep='-') + grpdj <- grpd[jj,] + if ('sample' %in% colnames(grpd)){ + fileid = grpdj$sample + }else{ + fileid = grpdj$fileid + } + name = paste(i, fileid, grpdj$pid, sep='-') write.msp(name,grpdj$precurMtchMZ,"",specj,of) } @@ -82,7 +88,13 @@ idx <- which(prec_int==max(prec_int)) grpd <- grpd[idx,] - name = paste(i, grpd$sample, grpd$pid, sep='-') + if ('sample' %in% colnames(grpd)){ + fileid = grpd$sample + }else{ + fileid = grpd$fileid + } + + name = paste(i, fileid, grpd$pid, sep='-') write.msp(name,grpd$precurMtchMZ,"",specj[[idx]], of) } @@ -175,7 +187,12 @@ spec <- spec[[1]] grpd <- grped_df[j,] - name = paste(i, grpd$sample, grpd$pid, sep='-') + if ('sample' %in% colnames(grpd)){ + fileid = grpd$sample + }else{ + fileid = grpd$fileid + } + name = paste(i, fileid, grpd$pid, sep='-') write.msp(name,grpd$precurMtchMZ,"",spec,of) } } diff -r 49e063070647 -r 78885fff83a3 create_msp.xml --- a/create_msp.xml Tue Jul 17 12:30:24 2018 -0400 +++ b/create_msp.xml Wed Jul 18 06:06:32 2018 -0400 @@ -1,4 +1,4 @@ - + macros.xml