Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: allow more mismatches (scale by read length) #60

Open
2 of 5 tasks
colindaven opened this issue May 27, 2020 · 3 comments
Open
2 of 5 tasks

request: allow more mismatches (scale by read length) #60

colindaven opened this issue May 27, 2020 · 3 comments
Assignees

Comments

@colindaven
Copy link
Contributor

colindaven commented May 27, 2020

  • if longer reads are used than our standard (ca 76bp) then more mismatches shiould be accepted
  • check for a new mismatch program (more flexible bamfilter on mismatches
  • otherwise just adjust and expand current clunky method
  • stay conservative: 0-100 - 2mm allowed, 100-150 -3mm allowed, 150-300 -4mm allowed ?
  • user can set parameter at runtime
  • write test for too many mismatches in filtered BAM !
@colindaven
Copy link
Contributor Author

@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

@colindaven
Copy link
Contributor Author

colindaven commented Aug 6, 2020

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"
}

@colindaven
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants