Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update fct_groupCorr.R to incorporate rt correction #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions R/fct_groupCorr.R
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ getMaxScans <- function(object){
if(nfiles == 1){
if (file.exists(filepaths(object@xcmsSet)[1])) {
xraw <- xcmsRaw(filepaths(object@xcmsSet)[1],profstep=0)
xraw@scantime <- object@xcmsSet@rt$corrected[[1]]
maxscans <- length(xraw@scantime)
}else {
stop('Raw data file:',filepaths(object@xcmsSet)[1],' not found ! \n');
Expand All @@ -759,6 +760,7 @@ getMaxScans <- function(object){
for (f in 1:nfiles){
if(file.exists(filepaths(object@xcmsSet)[f])) {
xraw <- xcmsRaw(filepaths(object@xcmsSet)[f], profstep=0);
xraw@scantime <- object@xcmsSet@rt$corrected[[f]];
maxscans <- max(maxscans, length(xraw@scantime));
} else {
stop('Raw data file:',filepaths(object@xcmsSet)[f],' not found ! \n');
Expand Down Expand Up @@ -787,6 +789,7 @@ setMethod("getAllPeakEICs", "xsAnnotate", function(object, index=NULL){
if (file.exists(filepaths(object@xcmsSet)[1])) {

xraw <- xcmsRaw(filepaths(object@xcmsSet)[1],profstep=0)
xraw@scantime <- object@xcmsSet@rt$corrected[[1]]
maxscans <- length(xraw@scantime)
scantimes[[1]] <- xraw@scantime
pdata <- as.data.frame(object@xcmsSet@peaks)
Expand All @@ -809,6 +812,7 @@ setMethod("getAllPeakEICs", "xsAnnotate", function(object, index=NULL){

if (file.exists(filepaths(object@xcmsSet)[1])) {
xraw <- xcmsRaw(filepaths(object@xcmsSet)[1],profstep=0)
xraw@scantime <- object@xcmsSet@rt$corrected[[1]]
maxscans <- length(xraw@scantime)
} else {
stop('Raw data file:',filepaths(object@xcmsSet)[1],' not found ! \n');
Expand All @@ -832,6 +836,7 @@ setMethod("getAllPeakEICs", "xsAnnotate", function(object, index=NULL){
if (file.exists(filepaths(object@xcmsSet)[f])) {
#read sample
xraw <- xcmsRaw(filepaths(object@xcmsSet)[f], profstep=0);
xraw@scantime <- object@xcmsSet@rt$corrected[[f]];
maxscans.tmp <- length(xraw@scantime);
scantimes[[f]] <- xraw@scantime
if(maxscans.tmp > maxscans){
Expand Down Expand Up @@ -972,6 +977,7 @@ getAllEICs <- function(xs,index=NULL,file=NULL) {
for (f in 1:nfiles){
# cat('Reading raw data file:',filepaths(xs)[f])
xraw <- xcmsRaw(filepaths(xs)[f],profstep=0)
xraw@scantime <- xs@rt$corrected[[f]]
# cat(',', length(xraw@scantime),'scans. \n')
maxscans <- max(maxscans,length(xraw@scantime))
scantimes[[f]] <- xraw@scantime
Expand All @@ -981,6 +987,7 @@ getAllEICs <- function(xs,index=NULL,file=NULL) {
if (file.exists(filepaths(xs)[f])) {
# cat('Reading raw data file:',filepaths(xs)[f],'\n')
xraw <- xcmsRaw(filepaths(xs)[f],profstep=0)
xraw@scantime <- xs@rt$corrected[[f]]
# cat('Generating EIC\'s .. \n')
idx.peaks <- which(index == f);
if(length(idx.peaks)>0){
Expand All @@ -998,6 +1005,7 @@ getAllEICs <- function(xs,index=NULL,file=NULL) {
if (file.exists(filepaths(xs)[1])) {
#cat('Reading raw data file:',filepaths(xs)[1],'\n')
xraw <- xcmsRaw(filepaths(xs)[1],profstep=0)
xraw@scantime <- xs@rt$corrected[[1]]
#cat('Generating EIC\'s .. \n')
maxscans <- length(xraw@scantime)
scantimes[[1]] <- xraw@scantime
Expand Down