Sorry. My PI is interested in how many reads with SMART-seq unique adapters, and he only wants the reads with the adapter for downstream analysis. That's why I posted this question.
I am currently doing a paired-end SMART-seq(an low input method of RNA-seq) data. I am interested in selecting the reads with SMART-Seq unique adapter ( 5' end adapter).
I am trying to do the job in R. I can use the Bioconductor tool, ShortRead to read the fastq file, then I can extract the read sequences and convert it to a vector. Then I can detect the reads with the adapter and pick them up by stringr. But definitely, I can't convert the vector back to the fastq file and to do any downstream analysis.
Anyone knows how to select reads with a certain adapter in a fastq file? is there any R tool can achieve this job? Thank you.
1 answer
You posted already some questions about this, and I can tell you R is definitely the wrong choice for this. Why don't you simply do what all people do: Run the files through fastqc, that will tell you if and which adapter is overrepresented. If there is contamination then trim it with Cutadapt which you already seem to be using based on your previous question. There is always only one type of adapter, it cannot be that there is both a SMARTseq and an Illumina Universal Adapter contamination, this is not how these libraries were prepared. Trim then if necessary, and then proceed with downstream analysis. There is no usecase that I can imagine (please proof me wrong if necessary) where you would need to load fastq reads into R, just trim stuff with standard tools and then align them, don't overthink this.
Probably you want bbduk https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/bbduk-guide/ which has an option to output the reads that contain certain adapters (kmers). Still, I would really think about whether this analysis makes any sense, as it is stochastic which reads contain adapters and which don't based on the fragment length of the cDNA, this is not a directed process.
Thank you, I will read the link you sent to me. I don't understand well and do not have much experience, I have to follow my PI's instruction.
Log in to answer this question.