I have an tximport object with 628 files. I want to subset to remove some samples and maintain the tximport data structure.
str(txi_object)
List of 4
$ abundance : num [1:56928, 1:628] 14.125 0 15.221 12.45 0.765 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:56928] "5S_rRNA" "5_8S_rRNA" "7SK" "A1BG" ...
.. ..$ : chr [1:628] "20798913" "20914669" "50301125" "20149910" ...
$ counts : num [1:56928, 1:628] 10.5 0 87.1 440 74.9 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:56928] "5S_rRNA" "5_8S_rRNA" "7SK" "A1BG" ...
.. ..$ : chr [1:628] "20798913" "20914669" "50301125" "20149910" ...
$ length : num [1:56928, 1:628] 15.1 24.2 116.4 718.5 1990.3 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : chr [1:56928] "5S_rRNA" "5_8S_rRNA" "7SK" "A1BG" ...
.. ..$ : chr [1:628] "20798913" "20914669" "50301125" "20149910" ...
$ countsFromAbundance: chr "no"
Final number of desired samples is 598 and I have the sample ids in a data frame. I tried mapply and ddply without much success.
length(clean_samples$individualID)
[1] 598
Any ideas or suggestions would be helpful
regards
scanchi
p.s - I had to post the code as text as I was running into an language '"x" not supported issue.
Hi James,
I was wondering if you know how I could remove samples from the tximport object which are contained in a list of outliers? Thanks!
If you are going to use edgeR or DESeq2 later, the easiest is to make the object and then subset that, e.g.
Many thanks, Michael! This is super useful, as usual!
Thank you James!