You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in src/r/edger.r i had to change the read.csv command to include the argument check.names = FALSE to avoid an error due to a "-" in my sample identifiers
further explanation:
in my design.csv file some of my sample names have "-" in the title. while using the edger.r script i continued to get the error: "Error in [.data.frame(counts_df, , sample_names) :
undefined columns selected"
turns out at the edger.r script at around line 139 the command: Read the data from the counts file.
counts_df = read.csv(counts_file, strip.white = T, stringsAsFactors = F)
was inserting "." for the "-" in the counts.df column names
at first I just used: Replace periods with hyphens in column names
but realized i could set the argument
check.names = FALSE in read.csv, then R will not override the names, as so: Read the data from the counts file.
counts_df = read.csv(counts_file, check.names = FALSE, strip.white = T, stringsAsFactors = F)
however, others pointed out that "these names are not valid in R and they'll have to be handled differently than valid names."
however, they seemed to work fine so far in this case.
had to do the same in the heatmap.r around lines 90 & 122 Read the design file.
inp <- read.csv(design_file, strip.white = T, stringsAsFactors = F)
insert the argument check.names = FALSE, here as well.
#Update
the above error came from the counts file only when using the salmon and edger.r methods. I have inadvertently created an issue using the altered .r files with the featurecounts and hisat2 alginment and featurecounts methods, as the counts file does already have "." instead of "-". But I can easily reload the originals with bio code -u. but that didn't fix it, so used the '# Replace periods with hyphens in column names
colnames(count_df) <- gsub(".", "-", colnames(count_df))
FWIW, If anyone else tries to fix with # Replace periods with hyphens in column names colnames(counts_df) <- gsub(".", "-", colnames(counts_df))
please know that in the edger.r script 'counts_df' is used whereas in the deseq2.r script 'count_df' is used.
Finally, easiest to just remove "-" symbols from column names. Mine was a carryover from the original bio search PRJNAXXXXXX-H --csv --all > PRJNAXXXXXX.csv , so the "-" came from the authors descriptions of the samples.....
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
in src/r/edger.r i had to change the read.csv command to include the argument check.names = FALSE to avoid an error due to a "-" in my sample identifiers
further explanation:
in my design.csv file some of my sample names have "-" in the title. while using the edger.r script i continued to get the error: "Error in
[.data.frame
(counts_df, , sample_names) :undefined columns selected"
turns out at the edger.r script at around line 139 the command:
Read the data from the counts file.
counts_df = read.csv(counts_file, strip.white = T, stringsAsFactors = F)
was inserting "." for the "-" in the counts.df column names
at first I just used:
Replace periods with hyphens in column names
but realized i could set the argument
check.names = FALSE in read.csv, then R will not override the names, as so:
Read the data from the counts file.
counts_df = read.csv(counts_file, check.names = FALSE, strip.white = T, stringsAsFactors = F)
however, others pointed out that "these names are not valid in R and they'll have to be handled differently than valid names."
however, they seemed to work fine so far in this case.
had to do the same in the heatmap.r around lines 90 & 122
Read the design file.
inp <- read.csv(design_file, strip.white = T, stringsAsFactors = F)
insert the argument check.names = FALSE, here as well.
#Update
the above error came from the counts file only when using the salmon and edger.r methods. I have inadvertently created an issue using the altered .r files with the featurecounts and hisat2 alginment and featurecounts methods, as the counts file does already have "." instead of "-". But I can easily reload the originals with bio code -u. but that didn't fix it, so used the '# Replace periods with hyphens in column names
colnames(count_df) <- gsub(".", "-", colnames(count_df))
FWIW, If anyone else tries to fix with # Replace periods with hyphens in column names colnames(counts_df) <- gsub(".", "-", colnames(counts_df))
please know that in the edger.r script 'counts_df' is used whereas in the deseq2.r script 'count_df' is used.
Finally, easiest to just remove "-" symbols from column names. Mine was a carryover from the original bio search PRJNAXXXXXX-H --csv --all > PRJNAXXXXXX.csv , so the "-" came from the authors descriptions of the samples.....
Beta Was this translation helpful? Give feedback.
All reactions