I need to use cutadapt to trim the adapter sequences and save these adapter sequences in a fastq file along with the cutadapt output files. Is there a way to do this? Or can I use cutadapt without trimming the adapter?
An example of the input you have and the output you want would help clarify a bunch of things at once (is this paired end or single? do you want just the adapters in the extra output or adapters onward? etc.). In any case you might find the info file feature and the --action argument useful.
The best way to generate a file with adapter sequences, when you don't know the adapter sequences apriori, is this:
1) Download BBTools from https://sourceforge.net/projects/bbmap/
2) Run bbmerge.sh in=reads.fq outa=adapters.fa
That's for interleaved files. If you have twin files you would do it like this:
3) bbmerge.sh in=something_R#.fq outa=adapters.fa
Once you have the adapters, you can do this:
4) bbduk.sh in=reads.fq out=trimmed.fq.gz ktrim=r k=23 mink=11 hdist=1 tbo tpe ref=adapters.fa ftm=5
or
5) bbduk.sh in=whatever_R#.fq out=trimmed_R#.fq ktrim=r k=23 mink=11 hdist=1 tbo tpe ref=adapters.fa ftm=5
Now you will have adapter-free reads that you can do bioinformatics with.
Please illustrate with a precise example of how output is supposed to look like.
I need a separate output file containing the adapter sequences it has trimmed
An example of the input you have and the output you want would help clarify a bunch of things at once (is this paired end or single? do you want just the adapters in the extra output or adapters onward? etc.). In any case you might find the info file feature and the --action argument useful.
thank you Jesse. this helps. Yes it is a paired end sequencing and I am looking for just the adapters. I shall try this