<p>@ATPoint commented that <em>the default kmer size in Salmon indexing is 31</em>, which led me to a solution that involved altering the index generation step:</p>
<p>Instead of:</p>
<pre><code>salmon index -t merged_salmon_<span class="math-container">${targetName}.fasta -i salmonIndex_$</span>{targetName}
</code></pre>
<p>I now have:</p>
<pre><code>salmon index -t merged_salmon_<span class="math-container">${targetName}.fasta -i salmonIndex_k11_$</span>{targetName} -k 11
</code></pre>
<p>In other words, I changed the kmer size from its default of 31 to 11, which matches the BD-recommended seed substring length for the standard Bowtie2 approach (&quot;-L 10&quot;, but I increased that to 11 because Salmon needs odd kmer sizes). I'm pretty sure that my 28bp-mapping reads won't be picked up with a kmer size of 31. Because this is targeted sequencing, I don't expect that a reduced kmer size will be an issue, but I'll keep a watch out for that.</p>
<p>I'm currently re-running the analysis. If it still doesn't work, then I'll see about adding in the tweaks suggested by @nomad.</p>
<p>Update: still not working, so I'll shift onto score tweaks.</p>

CC BY-SA 4.0
2021-06-08T03:25:20.700Z
2021-06-08T03:56:19.840Z
2021-06-08T03:56:19.840Z
gringer
<p>So, I think there are a few potential options here.  Alevin is using selective-alignment internally to determine the mappings for the reads.  So, even if you have a k-mer supporting the mapping, if you have gibberish for the rest of the read, the mapping score is going to be very poor and you're not going to recover that mapping locus.  There are some parameters you can mess with to try to increase the sensitivity of mapping, though you should always be aware that upping the sensitivity a lot will mean there is less aggressive filtering early in the mapping process which can slow things down.  The main parameter you should tweak to allow lower alignment scores is <code>--minScoreFraction</code>; the smaller this value the lower (worse) will be the permitted scores for valid mappings.  Additionally, you can combine changes to the <code>--minScoreFraction</code> with the <code>--softclip</code> option to simply score the non-matching end of read as 0 (rather than a long deletion or large set of mismatches); this will lower the effect of bad read ends.</p>
<p>Another alternative you might consider is to try out <a href="https://alevin-fry.readthedocs.io/en/latest/" rel="nofollow noreferrer">alevin-fry</a> for processing this data, and mapping the reads with the <code>--sketch</code> flag.  This will only check certain structural constraints of the mapping and won't force a particular minimum alignment score.  The caveat here is that dropping the requirement for alignment scoring can increase the rate of spurious mappings (reads deriving from elsewhere that spuriously map to some indexed target simply by virtue of sharing some sequence).  In transcriptome wide analyses, <a href="https://combine-lab.github.io/alevin-fry-tutorials/2021/improving-txome-specificity/" rel="nofollow noreferrer">this can be greatly mitigated by building an appropriate index and using a UMI resolution strategy that complements this expanded index</a>. We've not examined this in detail for targeted single-cell sequencing.  However, if you want to give it a try and run into any issues, feel free to drop an issue over on <a href="https://github.com/COMBINE-lab/alevin-fry/issues" rel="nofollow noreferrer">GitHub</a> and we'd be happy to help work through it.</p>

CC BY-SA 4.0
2021-06-08T08:47:38.103Z
Thank you; tweaking the minScoreFraction did the trick. I went from a max Cxcr4 read count per cell of 1 with default parameters, to 4 with `minScoreFraction=0.5`, to 26 with `minScoreFraction=0.33`.
gringer
CC BY-SA 4.0
2021-06-08T03:14:08.700Z
2021-06-08T03:14:08.700Z
nomad
<p>I'm in a little bit of a bind with targeted single-cell sequencing. I'm trying to match up our reads to the targeted amplicon panel (418 targets), and all but one have matched successfully with Salmon Alevin. I have a transcript that produces many 75bp reads that only match the first 28bp of a target, and Alevin is ignoring those reads as a match (the 28bp sequence is genome-unique).</p>
<p>Here's an example read, with matched sequence:</p>
<pre><code>qual FFFFFFFFFFFFFFFFFFFFFFFFFFFF,,,::,,:,:,,,,,,,,,,,,,,,,,:,,,,,,,,:,,,,,:,:
read GCTGCATAATCTCTTCATTCCGAGGAGCACCCCACGCGCGCCGCGCCCCCCCGCCCCCGGGGGGGGGGGGGGG
SNPs ...................................G.G.G..G.GC.....CG...CCGGGGGGGGG..GG..
 ref GCTGCATAATCTCTTCATTCCGAGGAGCACCCCACCCCCACCCCCACCCCCACCCCATTCTTAAATTGTTTGG
</code></pre>
<p>As you may be able to see from the above sequence, the reads for this particular transcript get up to 28bp (sometimes with one or two errors), then the wheels start coming off the sequencer, showing an abundance of Gs. This was a NovaSeq run, and a polyG read is the same as no signal using its two-dye process, so I suspect that the sequencing stops after ~35bp, rather than actually synthesising Gs from thin air.</p>
<p>I have lots of these reads; there are about 400k reads that match the reference transcript (Cxcr4, just in case it matters), and about 250k of those reads have a G homopolymer that's at least 8bp in length.</p>
<p>Any ideas on what to do?</p>
<p>FWIW, the above match was taken from a Bowtie2 alignment I did on the reads. I could use Alevin for cell barcode correction only and do the UMI deduplication manually, but it seems a shame to do that when it's only one transcript (from 418) that's spoiling a fully-automated process.</p>
<p>I did try adding in an additional transcript that included the full sequence of a short-match read, but there seem to be too many errors in the non-matching sequence for any reads to count (at least... I <em>assume</em> that's why the counts are not coming through; I'm not quite sure how I can work out what's going on behind the scenes).</p>
<p>Is there any way to tweak Salmon Alevin to get it to accept these shorter matches? If I can change the kmer size, how do I do that?</p>
<p>End trimming is unlikely to help, because that's going to shorten the reads and make them less likely to map to the target sequence. I want a way to <em>include</em> these reads as valid hits to the target sequence.</p>

<scrnaseq><transcriptome><salmon>
How do I increase the sensitivity of Salmon Alevin?
# How do I increase the sensitivity of Salmon Alevin?

(Asked by: username_0 on 2021-06-07)

I'm in a little bit of a bind with targeted single-cell sequencing. I'm trying to match up our reads to the targeted amplicon panel (418 targets), and all but one have matched successfully with Salmon Alevin. I have a transcript that produces many 75bp reads that only match the first 28bp of a target, and Alevin is ignoring those reads as a match (the 28bp sequence is genome-unique).
Here's an example read, with matched sequence:
qual FFFFFFFFFFFFFFFFFFFFFFFFFFFF,,,::,,:,:,,,,,,,,,,,,,,,,,:,,,,,,,,:,,,,,:,:
read GCTGCATAATCTCTTCATTCCGAGGAGCACCCCACGCGCGCCGCGCCCCCCCGCCCCCGGGGGGGGGGGGGGG
SNPs ...................................G.G.G..G.GC.....CG...CCGGGGGGGGG..GG..
 ref GCTGCATAATCTCTTCATTCCGAGGAGCACCCCACCCCCACCCCCACCCCCACCCCATTCTTAAATTGTTTGG

As you may be able to see from the above sequence, the reads for this particular transcript get up to 28bp (sometimes with one or two errors), then the wheels start coming off the sequencer, showing an abundance of Gs. This was a NovaSeq run, and a polyG read is the same as no signal using its two-dye process, so I suspect that the sequencing stops after ~35bp, rather than actually synthesising Gs from thin air.
I have lots of these reads; there are about 400k reads that match the reference transcript (Cxcr4, just in case it matters), and about 250k of those reads have a G homopolymer that's at least 8bp in length.
Any ideas on what to do?
FWIW, the above match was taken from a Bowtie2 alignment I did on the reads. I could use Alevin for cell barcode correction only and do the UMI deduplication manually, but it seems a shame to do that when it's only one transcript (from 418) that's spoiling a fully-automated process.
I did try adding in an additional transcript that included the full sequence of a short-match read, but there seem to be too many errors in the non-matching sequence for any reads to count (at least... I assume that's why the counts are not coming through; I'm not quite sure how I can work out what's going on behind the scenes).
Is there any way to tweak Salmon Alevin to get it to accept these shorter matches? If I can change the kmer size, how do I do that?
End trimming is unlikely to help, because that's going to shorten the reads and make them less likely to map to the target sequence. I want a way to include these reads as valid hits to the target sequence.

**Tags:** scrnaseq, transcriptome, salmon

---

## 2 answers

### Answer by username_1 on 2021-06-08. Score: 4 | Accepted answer

So, I think there are a few potential options here. Alevin is using selective-alignment internally to determine the mappings for the reads. So, even if you have a k-mer supporting the mapping, if you have gibberish for the rest of the read, the mapping score is going to be very poor and you're not going to recover that mapping locus. There are some parameters you can mess with to try to increase the sensitivity of mapping, though you should always be aware that upping the sensitivity a lot will mean there is less aggressive filtering early in the mapping process which can slow things down. The main parameter you should tweak to allow lower alignment scores is `--minScoreFraction`; the smaller this value the lower (worse) will be the permitted scores for valid mappings. Additionally, you can combine changes to the `--minScoreFraction` with the `--softclip` option to simply score the non-matching end of read as 0 (rather than a long deletion or large set of mismatches); this will lower the effect of bad read ends.

Another alternative you might consider is to try out [alevin-fry](https://alevin-fry.readthedocs.io/en/latest/) for processing this data, and mapping the reads with the `--sketch` flag. This will only check certain structural constraints of the mapping and won't force a particular minimum alignment score. The caveat here is that dropping the requirement for alignment scoring can increase the rate of spurious mappings (reads deriving from elsewhere that spuriously map to some indexed target simply by virtue of sharing some sequence). In transcriptome wide analyses, [this can be greatly mitigated by building an appropriate index and using a UMI resolution strategy that complements this expanded index](https://combine-lab.github.io/alevin-fry-tutorials/2021/improving-txome-specificity/). We've not examined this in detail for targeted single-cell sequencing. However, if you want to give it a try and run into any issues, feel free to drop an issue over on [GitHub](https://github.com/COMBINE-lab/alevin-fry/issues) and we'd be happy to help work through it.

> **Comments:**
> **username_0**: Thank you; tweaking the minScoreFraction did the trick. I went from a max Cxcr4 read count per cell of 1 with default parameters, to 4 with `minScoreFraction=0.5`, to 26 with `minScoreFraction=0.33`.  

---

### Answer by username_0 on 2021-06-08. Score: 0

@ATPoint commented that the default kmer size in Salmon indexing is 31, which led me to a solution that involved altering the index generation step:
Instead of:
salmon index -t merged_salmon_${targetName}.fasta -i salmonIndex_${targetName}

I now have:
salmon index -t merged_salmon_${targetName}.fasta -i salmonIndex_k11_${targetName} -k 11

In other words, I changed the kmer size from its default of 31 to 11, which matches the BD-recommended seed substring length for the standard Bowtie2 approach ("-L 10", but I increased that to 11 because Salmon needs odd kmer sizes). I'm pretty sure that my 28bp-mapping reads won't be picked up with a kmer size of 31. Because this is targeted sequencing, I don't expect that a reduced kmer size will be an issue, but I'll keep a watch out for that.
I'm currently re-running the analysis. If it still doesn't work, then I'll see about adding in the tweaks suggested by @nomad.
Update: still not working, so I'll shift onto score tweaks.


---

