Tabnine Logo
BAMIndexMetaData.getAlignedRecordCount
Code IndexAdd Tabnine to your IDE (free)

How to use
getAlignedRecordCount
method
in
htsjdk.samtools.BAMIndexMetaData

Best Java code snippets using htsjdk.samtools.BAMIndexMetaData.getAlignedRecordCount (Showing top 16 results out of 315)

origin: samtools/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final int reference, final BAMIndexMetaData metaData) {
  final int nChunks = metaData == null ? 0 : 2;
  pw.print("  Ref " + reference + " bin 37450 has n_chunk= " + nChunks);
  if (nChunks == 0) {
    pw.println();
  } else {
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getFirstOffset(), 16) +
        " end: " + Long.toString(metaData.getLastOffset(), 16));
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getAlignedRecordCount(), 16) +
        " end: " + Long.toString(metaData.getUnalignedRecordCount(), 16));
  }
}
  
origin: com.github.samtools/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final int reference, final BAMIndexMetaData metaData) {
  final int nChunks = metaData == null ? 0 : 2;
  pw.print("  Ref " + reference + " bin 37450 has n_chunk= " + nChunks);
  if (nChunks == 0) {
    pw.println();
  } else {
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getFirstOffset(), 16) +
        " end: " + Long.toString(metaData.getLastOffset(), 16));
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getAlignedRecordCount(), 16) +
        " end: " + Long.toString(metaData.getUnalignedRecordCount(), 16));
  }
}
  
origin: org.seqdoop/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final int reference, final BAMIndexMetaData metaData) {
  final int nChunks = metaData == null ? 0 : 2;
  pw.print("  Ref " + reference + " bin 37450 has n_chunk= " + nChunks);
  if (nChunks == 0) {
    pw.println();
  } else {
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getFirstOffset(), 16) +
        " end: " + Long.toString(metaData.getLastOffset(), 16));
    pw.println("     Chunk: " + //  c.toString() +
        " start: " + Long.toString(metaData.getAlignedRecordCount(), 16) +
        " end: " + Long.toString(metaData.getUnalignedRecordCount(), 16));
  }
}
  
origin: com.github.samtools/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final BAMIndexMetaData metaData) {
  codec.writeInt(GenomicIndexUtil.MAX_BINS);
  final int nChunk = 2;
  codec.writeInt(nChunk);
  codec.writeLong(metaData.getFirstOffset());
  codec.writeLong(metaData.getLastOffset());
  codec.writeLong(metaData.getAlignedRecordCount());
  codec.writeLong(metaData.getUnalignedRecordCount());
}
origin: org.seqdoop/htsjdk

  continue;
System.out.println("\tAligned= " + data[i].getAlignedRecordCount() +
    "\tUnaligned= " + data[i].getUnalignedRecordCount());
origin: com.github.samtools/htsjdk

  continue;
System.out.println("\tAligned= " + data[i].getAlignedRecordCount() +
    "\tUnaligned= " + data[i].getUnalignedRecordCount());
origin: samtools/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final BAMIndexMetaData metaData) {
  codec.writeInt(GenomicIndexUtil.MAX_BINS);
  final int nChunk = 2;
  codec.writeInt(nChunk);
  codec.writeLong(metaData.getFirstOffset());
  codec.writeLong(metaData.getLastOffset());
  codec.writeLong(metaData.getAlignedRecordCount());
  codec.writeLong(metaData.getUnalignedRecordCount());
}
origin: pcingola/SnpEff

count += meta.getAlignedRecordCount();
origin: com.google.cloud.genomics/google-genomics-dataflow

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final BAMIndexMetaData metaData) {
  codec.writeInt(GenomicIndexUtil.MAX_BINS);
  final int nChunk = 2;
  codec.writeInt(nChunk);
  codec.writeLong(metaData.getFirstOffset());
  codec.writeLong(metaData.getLastOffset());
  codec.writeLong(metaData.getAlignedRecordCount());
  codec.writeLong(metaData.getUnalignedRecordCount());
}
origin: googlegenomics/dataflow-java

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final BAMIndexMetaData metaData) {
  codec.writeInt(GenomicIndexUtil.MAX_BINS);
  final int nChunk = 2;
  codec.writeInt(nChunk);
  codec.writeLong(metaData.getFirstOffset());
  codec.writeLong(metaData.getLastOffset());
  codec.writeLong(metaData.getAlignedRecordCount());
  codec.writeLong(metaData.getUnalignedRecordCount());
}
origin: org.seqdoop/htsjdk

/**
 * Write the meta data represented by the chunkLists associated with bin MAX_BINS 37450
 *
 * @param metaData information describing numAligned records, numUnAligned, etc
 */
private void writeChunkMetaData(final BAMIndexMetaData metaData) {
  codec.writeInt(GenomicIndexUtil.MAX_BINS);
  final int nChunk = 2;
  codec.writeInt(nChunk);
  codec.writeLong(metaData.getFirstOffset());
  codec.writeLong(metaData.getLastOffset());
  codec.writeLong(metaData.getAlignedRecordCount());
  codec.writeLong(metaData.getUnalignedRecordCount());
}
origin: dariober/ASCIIGenome

public static long getAlignedReadCount(String bam) throws IOException{
  /*  ------------------------------------------------------ */
  /* This chunk prepares SamReader from local bam or URL bam */
  UrlValidator urlValidator = new UrlValidator();
  SamReaderFactory srf=SamReaderFactory.make();
  srf.validationStringency(ValidationStringency.SILENT);
  SamReader samReader;
  if(urlValidator.isValid(bam)){
    samReader = SamReaderFactory.makeDefault().open(
        SamInputResource.of(new URL(bam)).index(new URL(bam + ".bai"))
    );
  } else {
    samReader= srf.open(new File(bam));
  }
  /*  ------------------------------------------------------ */
  List<SAMSequenceRecord> sequences = samReader.getFileHeader().getSequenceDictionary().getSequences();
  long alnCount= 0;
  for(SAMSequenceRecord x : sequences){
    alnCount += samReader.indexing().getIndex().getMetaData(x.getSequenceIndex()).getAlignedRecordCount();
  }
  samReader.close();
  return alnCount;
}
origin: samtools/htsjdk

final BAMIndexMetaData metaData_0 = index.getMetaData(0);
Assert.assertNotNull(metaData_0);
Assert.assertEquals(metaData_0.getAlignedRecordCount(), 1);
Assert.assertEquals(metaData_1.getAlignedRecordCount(), 3);
Assert.assertEquals(metaData_2.getAlignedRecordCount(), 2);
origin: samtools/htsjdk

  continue;
System.out.println("\tAligned= " + data[i].getAlignedRecordCount() +
    "\tUnaligned= " + data[i].getUnalignedRecordCount());
origin: broadinstitute/picard

  public static long countSamTotalRecord(final File samFile) {
    final SamReader reader = SamReaderFactory.make().open(samFile);
    assert reader.hasIndex();
    long total = 0;

    for (int i = 0; i < reader.getFileHeader().getSequenceDictionary().size(); i++) {
      total += reader.indexing().getIndex().getMetaData(i).getAlignedRecordCount();
      total += reader.indexing().getIndex().getMetaData(i).getUnalignedRecordCount();
    }
    return total;
  }
}
origin: googlegenomics/dataflow-java

BAMIndexMetaData metaData = reader.indexing().getIndex().getMetaData(sequenceIndex);
Assert.assertEquals(EXPECTED_ALL_READS - EXPECTED_UNMAPPED_READS,
  metaData.getAlignedRecordCount());
htsjdk.samtoolsBAMIndexMetaDatagetAlignedRecordCount

Popular methods of BAMIndexMetaData

  • getUnalignedRecordCount
  • getFirstOffset
  • getLastOffset
  • getNoCoordinateRecordCount
  • newReference
    Call for each new reference sequence encountered
  • recordMetaData
  • <init>
    Constructor used when reading an index construct one instance for each index generated
  • getIndexStats
    Prints meta-data statistics from BAM index (.bai) file Statistics include count of aligned and unali
  • incrementNoCoordinateRecordCount
    Call whenever a reference with no coordinate information is encountered in the bam file
  • printIndexStats
    Prints meta-data statistics from BAM index (.bai) file Statistics include count of aligned and unali
  • setNoCoordinateRecordCount
    Set local variable. Normally noCoordinateRecord count accessed from AbstractBAMFileIndex when readin
  • setNoCoordinateRecordCount

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now