Could I please ask, what does the gene lengths file look like?
Should I have a "rawcounts.txt" file that looks like this:
Sample1 Sample2 Sample3
Gene1 10 30 40
Gene2 20 40 50
Gene3 30 60 60
and then what should the "lengths.txt" file look like?
I made two lengths.txt files, one that looks like this:
Length,1000,2000,3000
(where each item in the list corresponds to the corresponding line in the raw counts file (so gene1 length = 1000, gene2 length = 2000, gene3 length = 3000), but I ran into errors, and then I also made a lengths.txt file like this:
Length
1000
2000
3000
Again, every row in this file corresponds to the gene length in the raw counts file (so Gene1 has length 1000, Gene2 has length 2000, Gene3 has length 3000). i'm running into some problems, but before I look more into what I'm doing wrong, I just want to check I have the file formats right.
Thanks.
The "not meaningful for factors" and the output of
head(gene-length[,1:4])show you what the problem is.In addition, pay attention to
dim(rawcounts)vsdim(gene-length).Thank you,
I tried many corrections for example I added a column as genes length to my raw counts file the header became like below
Then I tried
I tried with or with adding gene-length column. Then I tried like below
But I read the gene-length already even I tried by adding the length as an additional column to raw counts. Actually I can't figure out what is my fault. For example in
d$genes$Length <- c(1000,2000,500,1500,3000), what isgenes?Please help me because this time really it is not a lazy post. I promise I am trying for many hours, I have gene length, I have raw counts but I cant figure out what to do
Suppose you start with:
Note that V1 is "Length", that likely made the whole dataframe a factor rather than numeric. So:
or something along those lines.
thanks a lot Devon,
your tip worked well
I just noticed: your variable name
gene-lengthis invalid, and if you did not get an error means you are posting untested code, different from the one you are having real problems. This may result in a wild goose chase.but gene-length variable only was a name to ask my question clearly, if not what I posted below is the code I did finally in which I named length of gene as
mycounts1. if you mean the samemycounts1??