<p>The <code>minion</code> utility from the kraken/reaper toolkit may be helpful for this: <a href="http://wwwdev.ebi.ac.uk/enright-dev/kraken/reaper/src/reaper-latest/doc/minion.html" rel="nofollow noreferrer">http://wwwdev.ebi.ac.uk/enright-dev/kraken/reaper/src/reaper-latest/doc/minion.html</a></p>

CC BY-SA 3.0
2017-06-02T14:43:48.587Z
This looks like exactly the right type of tool. Although too bad it was designed mainly for the 3' end adapter. I wonder if you could just flip all your reads and apply it to the 5' end.
story
CC BY-SA 3.0
2017-06-02T11:41:15.883Z
2017-06-02T11:41:15.883Z
Nils
<p>You mention that FastQC <em>"fails to find the actual adapter sequences"</em> - I guess you mean in the Adapter Sequence Contamination plot. However, the kmer and Sequence Content Plots are often useful even when the former fails. I've used these in the past - you can sometimes just read off the adapter sequence from the start of the Sequence Content Plot (or at least see how many bases to trim).</p>

CC BY-SA 3.0
2017-06-02T07:52:08.220Z
2017-06-02T07:52:08.220Z
ewels
<p>I'm not aware of any existing methods to do this, but here are a couple of ideas about how it might be done:</p>

<p>Canu has a method of adapter trimming which involves looking for the absence of overlap for reads. If there are no other reads which share sequence across a particular region, then the read is broken up at the point of low coverage, and small pieces are discarded. It would be possible to use a method like this to hunt for possible adapter/barcode sequences by preserving the short reads.</p>

<p>Another option is to do a kmer search at the start of reads, and see if any of the high-abundance kmers can be assembled together and/or matched to existing known adapters or barcodes.</p>

CC BY-SA 3.0
2017-05-31T10:45:23.277Z
2017-05-31T10:45:23.277Z
gringer
<p>If you happen to know a sequence that should be highly abundant in the library, you can grep its beginning or end (with pattern match highlighting) and see if the same sequence systematically comes just before or just after respectively. This kind of visual inspection can help you finding the adaptor.</p>

<p>For instance, in a previous lab, we were working on <em>D. melanogaster</em> small RNA sequencing data and my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: <a href="http://flybase.org/reports/FBgn0065042.html" rel="nofollow noreferrer">http://flybase.org/reports/FBgn0065042.html</a></p>

<p>We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter.</p>

CC BY-SA 3.0
2017-06-01T12:29:50.357Z
May I know the reason of the downvote?

I've seen this method applied in a case of small RNA-seq, where one highly abundant sequence was expected. Visually inspecting the output of grep of this sequence (with pattern highlight) gave a very good hint of what the adaptor was (the non-highlighted part).
bli
CC BY-SA 3.0
2017-06-02T07:49:42.750Z
The question is asking about how to detect unknown adapter sequences, so the OP will not know about abundant sequences in advance. That's kind of the point of the question...
ewels
CC BY-SA 3.0
2017-06-02T08:04:59.507Z
@tallphil I don't see the link between not knowing the adapter and not knowing of an abundant sequence expected to be present in the data. If I remember well, in the example I mention in my comment, my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: http://flybase.org/reports/FBgn0065042.html

We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter.
bli
CC BY-SA 3.0
2017-06-02T14:36:21.790Z
Actually I just re-read your post and now I see what you meant. This is a reasonable idea. However, I think you explained it poorly in the sense that a reader might be confused and think you meant that searching for the most abundant sequence might come up with the barcode. You should have specified that the "abundant sequence" in this case was a known nucleic acid sequence that would be expected to have adapters ligated to one or both ends.
story
CC BY-SA 3.0
2017-06-03T08:58:39.340Z
Ah yes, apologies - this is exactly how I read it. Probably didn't help that the original question mentions grepping for expected adapter sequences, so this was fresh in my mind :) Sorry @bli! Downvote wasn't from me so I can't retract it I'm afraid.
ewels
CC BY-SA 3.0
2017-06-03T09:10:17.663Z
I tried to clarify my explanations.
bli
CC BY-SA 3.0
2017-05-31T10:28:26.410Z
2017-06-03T09:09:53.957Z
2017-06-03T09:09:53.957Z
bli
<p>I have often downloaded datasets from the SRA where the authors failed to mention which adapters were trimmed during the processing.</p>

<p>Local alignments tend to overcome this obstacle, but it feels a bit barbaric.</p>

<p>fastQC works occasionally to pick them up, but sometimes fails to find the actual adapter sequences.</p>

<p>Usually, I ended up looking up the kits they used and trying to grep for all the possible barcodes.</p>

<p>Is there a more robust/efficient way to do this?</p>

CC BY-SA 3.0
2017-05-31T10:24:55.727Z
This doesn't answer your question, but I hope there is a possibility to report such problems to SRA so that they ask the authors to publish the missing information.
bli
CC BY-SA 3.0
2017-05-31T11:01:29.690Z
Why do you feel that local alignment is a bit barbaric? It should be the default method in this day and age, unless you’re working with smallRNA sequencing. I tend to trim adapters to be on the safe side but I did lots of work without bothering, and just relying on local alignment.
Konrad Rudolph
<barcode><adapter><trimming>
How can I systematically detect unknown barcode/adapter sequences within a set of samples?
# How can I systematically detect unknown barcode/adapter sequences within a set of samples?

(Asked by: username_0 on 2017-05-31)

I have often downloaded datasets from the SRA where the authors failed to mention which adapters were trimmed during the processing.

Local alignments tend to overcome this obstacle, but it feels a bit barbaric.

fastQC works occasionally to pick them up, but sometimes fails to find the actual adapter sequences.

Usually, I ended up looking up the kits they used and trying to grep for all the possible barcodes.

Is there a more robust/efficient way to do this?

**Tags:** barcode, adapter, trimming
> **Comments:**
> **username_1**: This doesn't answer your question, but I hope there is a possibility to report such problems to SRA so that they ask the authors to publish the missing information.  
> **username_2**: Why do you feel that local alignment is a bit barbaric? It should be the default method in this day and age, unless you’re working with smallRNA sequencing. I tend to trim adapters to be on the safe side but I did lots of work without bothering, and just relying on local alignment.  

---

## 4 answers

### Answer by username_3 on 2017-06-02. Score: 1 | Accepted answer

The `minion` utility from the kraken/reaper toolkit may be helpful for this: <http://wwwdev.ebi.ac.uk/enright-dev/kraken/reaper/src/reaper-latest/doc/minion.html>

> **Comments:**
> **username_0**: This looks like exactly the right type of tool. Although too bad it was designed mainly for the 3' end adapter. I wonder if you could just flip all your reads and apply it to the 5' end.  

---

### Answer by username_4 on 2017-06-02. Score: 4

You mention that FastQC *"fails to find the actual adapter sequences"* - I guess you mean in the Adapter Sequence Contamination plot. However, the kmer and Sequence Content Plots are often useful even when the former fails. I've used these in the past - you can sometimes just read off the adapter sequence from the start of the Sequence Content Plot (or at least see how many bases to trim).


---

### Answer by username_5 on 2017-05-31. Score: 2

I'm not aware of any existing methods to do this, but here are a couple of ideas about how it might be done:

Canu has a method of adapter trimming which involves looking for the absence of overlap for reads. If there are no other reads which share sequence across a particular region, then the read is broken up at the point of low coverage, and small pieces are discarded. It would be possible to use a method like this to hunt for possible adapter/barcode sequences by preserving the short reads.

Another option is to do a kmer search at the start of reads, and see if any of the high-abundance kmers can be assembled together and/or matched to existing known adapters or barcodes.


---

### Answer by username_1 on 2017-05-31. Score: 1

If you happen to know a sequence that should be highly abundant in the library, you can grep its beginning or end (with pattern match highlighting) and see if the same sequence systematically comes just before or just after respectively. This kind of visual inspection can help you finding the adaptor.

For instance, in a previous lab, we were working on *D. melanogaster* small RNA sequencing data and my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: <http://flybase.org/reports/FBgn0065042.html>

We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter.

> **Comments:**
> **username_1**: May I know the reason of the downvote?  I've seen this method applied in a case of small RNA-seq, where one highly abundant sequence was expected. Visually inspecting the output of grep of this sequence (with pattern highlight) gave a very good hint of what the adaptor was (the non-highlighted part).  
> **username_4**: The question is asking about how to detect unknown adapter sequences, so the OP will not know about abundant sequences in advance. That's kind of the point of the question...  
> **username_1**: @tallphil I don't see the link between not knowing the adapter and not knowing of an abundant sequence expected to be present in the data. If I remember well, in the example I mention in my comment, my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: http://flybase.org/reports/FBgn0065042.html  We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter.  
> **username_0**: Actually I just re-read your post and now I see what you meant. This is a reasonable idea. However, I think you explained it poorly in the sense that a reader might be confused and think you meant that searching for the most abundant sequence might come up with the barcode. You should have specified that the "abundant sequence" in this case was a known nucleic acid sequence that would be expected to have adapters ligated to one or both ends.  
> **username_4**: Ah yes, apologies - this is exactly how I read it. Probably didn't help that the original question mentions grepping for expected adapter sequences, so this was fresh in my mind :) Sorry @bli! Downvote wasn't from me so I can't retract it I'm afraid.  
> **username_1**: I tried to clarify my explanations.  

---

