Hi, I would like to know if it is it possible to get the read length of the higher alignment in a bam file having more than 85% identity.
For example an output with this fields:
- Read_length
- Alignment_length
- Percent_identity
thanks
Hi, I would like to know if it is it possible to get the read length of the higher alignment in a bam file having more than 85% identity.
For example an output with this fields:
thanks
using bioalcidaejdk : http://lindenb.github.io/jvarkit/BioAlcidaeJdk.html
print : the read length using https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/samtools/Cigar.html#getReadLength-- , the reference length using https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/samtools/Cigar.html#getPaddedReferenceLength-- and the % of identify using the NM Attribute (must be present) https://samtools.github.io/hts-specs/SAMtags.pdf
java -jar dist/bioalcidaejdk.jar -e 'stream().filter(R->!R.getReadUnmappedFlag() && R.getCigar()!=null).forEach(R->println(R.getReadLength()+" "+R.getCigar().getPaddedReferenceLength()+" "+((double)(R.getReadLength()- R.getIntegerAttribute("NM")))/R.getReadLength()));' in.bam
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
You can do this with pysam. Do you have any (Python) coding experience?
I´m more of a perl guy but can give it a try