Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • cstack
    Member
    • May 2017
    • 16

    bbduk.sh masking shorter than k-mer size

    I've come across a situation using bbduk to mask the k-mers from one genome assembly in another where the resulting number of masked bases is some sequences is shorter than the k value.

    I am running the command like this:
    Code:
    # version 37.something.  
    bbduk.sh in=mygenome.fa out=mygenome_masked.fa ref=ecoli.fasta k=15 
    qkmask=X maskfullycovered=t maskmiddle=f
    In mygenome_masked.fa (a multisequence fasta file), there are a sizable number of sequences with a total of 0 < bases_masked < k(=15). It seems strange to have 3 nucleotides masked when k=15, and I am wondering if anyone can point out what options I should be using to prevent this from happening
  • Brian Bushnell
    Super Moderator
    • Jan 2014
    • 2709

    #2
    That would be the "maskfullycovered" flag. That means only bases covered entirely by reference kmers will be masked.

    For example, take this sequence you want to mask:

    Code:
    ACGTTGCA
    And this reference:

    Code:
    CGTTG
    The ref kmers (ignoring reverse complement, at K=3) are CGT, GTT, and TTG. They line up like:
    Code:
       TTG
      GTT
     CGT
    ACGTTGCA
    Every based is covered by 3 kmers, but only the first T is "fully covered" - covered by 3 ref kmers. So it's the only one masked. Whereas without "maskfullycovered", the entire CGTTG would be masked.

    Incidentally, it depends on what your goal is, but normally I find K=15 to be very short for masking... typically I use K=31.

    Comment

    • cstack
      Member
      • May 2017
      • 16

      #3
      Thanks! I had been thinking about maskfullycovered incorrectly.

      Incidentally, it depends on what your goal is, but normally I find K=15 to be very short for masking... typically I use K=31.
      The sequences I was trying to mask were from a very rough (initial) assembly of 10-20x worth of uncorrected 1d Minion reads. The assembly probably has a fair few errors, so I tried a range of k values to see if I could find any obvious contamination. K=15 turned out to be way too sensitive, like you say.

      Are there parameter values you'd recommend (for either bbduk or seal) for identifying contaminants in high-error-rate (~15%) reads?

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM
      • GATTACAT
        Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
        by GATTACAT
        Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
        07-01-2026, 11:43 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      32 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-08-2026, 10:08 AM
      0 responses
      20 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-07-2026, 11:05 AM
      0 responses
      34 views
      0 reactions
      Last Post SEQadmin2  
      Working...