Coder Social home page Coder Social logo

Comments (3)

colindaven avatar colindaven commented on June 15, 2024

@Colorstorm I'm still v busy with cluster setup + teaching, so if you get a chance to look at this then please have a go (new branch). cheers

from wochenende.

colindaven avatar colindaven commented on June 15, 2024

Which tags to use ?

Minimap: NM:i:626
ngmlr: NM:i:493

bamutil - mismatch threshold (for read end clipping, set to 0.10 = 10% bases being mismatches). Works on BAMs
https://genome.sph.umich.edu/wiki/BamUtil:_filter

bamtools
Save this file and use as the -script parameter

bamtools filter json (must this be dyn created to get NM per read length ? for each read ?Unworkable ...

#short reads?
{
  "mapQuality" : ">30",
 "tag" : "NM:<4"
}

#long reads?
{
  "mapQuality" : ">30",
 "tag" : "NM:<100"
}

# all reads?
{
  "mapQuality" : ">30",
 "tag" : "NM:< READLENGTH/10"
}

from wochenende.

colindaven avatar colindaven commented on June 15, 2024

This has been implemented with bamtools (avoids multiple inefficient steps saving and merging BAMs), but is NOT adapted for read length (i.e. long reads) but is fixed for all read lengths.

Before:

cat sample_metagen_R1.s.bam.txt.filt.sort.csv

1_CP020566_1_Veillonella_atypica_strain_OK5_chromosome__complete_genome_BAC     2071952 136     0
1_CP023863_1_Prevotella_jejuni_strain_CD3_33_chromosome_I__complete_sequence_BAC        2204592 98      0
1_CP001721_1_Atopobium_parvulum_DSM_20469__complete_genome_BAC  1543805 44      0
1_CP024698_1_Fusobacterium_periodonticum_strain_KCOM_1283_chromosome__complete_genome_BAC       2222370 30      0
1_CP012068_1_Eubacterium_sulci_ATCC_35585__complete_genome_BAC  1739380 26      0
1_CP002122_1_Prevotella_melaninogenica_ATCC_25845_chromosome_I__complete_sequence_BAC   1796408 22      0

After (removing those with >=250 mismatches):
cat sample_metagen_R1.s.mq30.mm.bam.txt.filt.sort.csv

1_CP020566_1_Veillonella_atypica_strain_OK5_chromosome__complete_genome_BAC     2071952 118     0
1_CP023863_1_Prevotella_jejuni_strain_CD3_33_chromosome_I__complete_sequence_BAC        2204592 88      0
1_CP001721_1_Atopobium_parvulum_DSM_20469__complete_genome_BAC  1543805 32      0
1_CP024698_1_Fusobacterium_periodonticum_strain_KCOM_1283_chromosome__complete_genome_BAC       2222370 24      0

from wochenende.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.