Tabnine Logo
BAMIndexMetaData.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
htsjdk.samtools.BAMIndexMetaData
constructor

Best Java code snippets using htsjdk.samtools.BAMIndexMetaData.<init> (Showing top 11 results out of 315)

origin: com.github.samtools/htsjdk

  /**
   * Prints meta-data statistics from BAM index (.bai) file
   * Statistics include count of aligned and unaligned reads for each reference sequence
   * and a count of all records with no start coordinate
   */
  static public BAMIndexMetaData[] getIndexStats(final BAMFileReader bam) {

    AbstractBAMFileIndex index = (AbstractBAMFileIndex) bam.getIndex();
    // read through all the bins of every reference.
    int nRefs = index.getNumberOfReferences();
    BAMIndexMetaData[] result = new BAMIndexMetaData[nRefs == 0 ? 1 : nRefs];
    for (int i = 0; i < nRefs; i++) {
      result[i] = index.getMetaData(i);
    }

    if (result[0] == null) {
      result[0] = new BAMIndexMetaData();
    }
    final Long noCoordCount = index.getNoCoordinateCount();
    if (noCoordCount != null)  // null in old index files without metadata
      result[0].setNoCoordinateRecordCount(noCoordCount);

    return result;
  }
}
origin: org.seqdoop/htsjdk

  /**
   * Prints meta-data statistics from BAM index (.bai) file
   * Statistics include count of aligned and unaligned reads for each reference sequence
   * and a count of all records with no start coordinate
   */
  static public BAMIndexMetaData[] getIndexStats(final BAMFileReader bam){

    AbstractBAMFileIndex index = (AbstractBAMFileIndex) bam.getIndex();
    // read through all the bins of every reference.
    int nRefs = index.getNumberOfReferences();
    BAMIndexMetaData[] result = new BAMIndexMetaData[nRefs == 0 ? 1 : nRefs];
    for (int i = 0; i < nRefs; i++) {
      result[i] = index.getMetaData(i);
    }

    if (result[0] == null){
      result[0] = new BAMIndexMetaData();
    }
    final Long noCoordCount = index.getNoCoordinateCount();
    if (noCoordCount != null)  // null in old index files without metadata
      result[0].setNoCoordinateRecordCount(noCoordCount);

    return result;
  }
}
origin: samtools/htsjdk

  /**
   * Prints meta-data statistics from BAM index (.bai or .csi) file
   * Statistics include count of aligned and unaligned reads for each reference sequence
   * and a count of all records with no start coordinate
   */
  static public BAMIndexMetaData[] getIndexStats(final BAMFileReader bam) {

    AbstractBAMFileIndex index = (AbstractBAMFileIndex) bam.getIndex();
    // read through all the bins of every reference.
    int nRefs = index.getNumberOfReferences();
    BAMIndexMetaData[] result = new BAMIndexMetaData[nRefs == 0 ? 1 : nRefs];
    for (int i = 0; i < nRefs; i++) {
      result[i] = index.getMetaData(i);
    }

    if (result[0] == null) {
      result[0] = new BAMIndexMetaData();
    }
    final Long noCoordCount = index.getNoCoordinateCount();
    if (noCoordCount != null)  // null in old index files without metadata
      result[0].setNoCoordinateRecordCount(noCoordCount);

    return result;
  }
}
origin: samtools/htsjdk

/**
 * Return meta data for the given reference including information about number of aligned, unaligned, and noCoordinate records
 *
 * @param reference the reference of interest
 * @return meta data for the reference
 */
@Override
public BAMIndexMetaData getMetaData(final int reference) {
  seek(4);
  final List<Chunk> metaDataChunks = new ArrayList<Chunk>();
  final int sequenceCount = readInteger();
  if (reference >= sequenceCount) {
    return null;
  }
  skipToSequence(reference);
  final int binCount = readInteger();
  for (int binNumber = 0; binNumber < binCount; binNumber++) {
    final int indexBin = readInteger();
    final int nChunks = readInteger();
    if (indexBin == GenomicIndexUtil.MAX_BINS) {
      readChunks(nChunks, metaDataChunks);
    } else {
      skipBytes(16 * nChunks);
    }
  }
  return new BAMIndexMetaData(metaDataChunks);
}
origin: org.seqdoop/htsjdk

/**
 * Return meta data for the given reference including information about number of aligned, unaligned, and noCoordinate records
 *
 * @param reference the reference of interest
 * @return meta data for the reference
 */
public BAMIndexMetaData getMetaData(final int reference) {
  seek(4);
  final List<Chunk> metaDataChunks = new ArrayList<Chunk>();
  final int sequenceCount = readInteger();
  if (reference >= sequenceCount) {
    return null;
  }
  skipToSequence(reference);
  final int binCount = readInteger();
  for (int binNumber = 0; binNumber < binCount; binNumber++) {
    final int indexBin = readInteger();
    final int nChunks = readInteger();
    if (indexBin == GenomicIndexUtil.MAX_BINS) {
      for (int ci = 0; ci < nChunks; ci++) {
        final long chunkBegin = readLong();
        final long chunkEnd = readLong();
        metaDataChunks.add(new Chunk(chunkBegin, chunkEnd));
      }
    } else {
      skipBytes(16 * nChunks);
    }
  }
  return new BAMIndexMetaData(metaDataChunks);
}
origin: com.github.samtools/htsjdk

return new BAMIndexMetaData(metaDataChunks);
origin: samtools/htsjdk

return new BAMIndexContent(referenceSequence, bins, binCount - (metaDataSeen? 1 : 0), new BAMIndexMetaData(metaDataChunks), linearIndex);
origin: samtools/htsjdk

return new BAMIndexContent(referenceSequence, bins, binCount - (metaDataSeen? 1 : 0), new BAMIndexMetaData(metaDataChunks), null);
origin: org.seqdoop/htsjdk

return new BAMIndexContent(referenceSequence, bins, binCount - (metaDataSeen? 1 : 0), new BAMIndexMetaData(metaDataChunks), linearIndex);
origin: com.github.samtools/htsjdk

return new BAMIndexContent(referenceSequence, bins, binCount - (metaDataSeen? 1 : 0), new BAMIndexMetaData(metaDataChunks), linearIndex);
origin: samtools/htsjdk

/**
 * Return meta data for the given reference including information about number of aligned, unaligned, and noCoordinate records
 *
 * @param reference the reference of interest
 * @return meta data for the reference
 */
@Override
public BAMIndexMetaData getMetaData(final int reference) {
  if (metaDataPos > 0 && position() != metaDataPos) {
    seek(metaDataPos);
  }
  final List<Chunk> metaDataChunks = new ArrayList<Chunk>();
  final int sequenceCount = getNumberOfReferences();
  if (reference >= sequenceCount) {
    return null;
  }
  skipToSequence(reference);
  final int binCount = readInteger(); // n_bin
  for (int binNumber = 0; binNumber < binCount; binNumber++) {
    final int indexBin = readInteger(); // bin
    final long lOffset = readLong(); // loffset
    final int nChunks = readInteger(); // n_chunk
    if (indexBin == getMaxBins() + 1) {
      readChunks(nChunks, metaDataChunks);
    } else {
      skipBytes(BAMFileConstants.CSI_CHUNK_SIZE * nChunks);
    }
  }
  return new BAMIndexMetaData(metaDataChunks);
}
htsjdk.samtoolsBAMIndexMetaData<init>

Javadoc

Constructor used when writing an index construct one instance for each index generated

Popular methods of BAMIndexMetaData

  • getAlignedRecordCount
  • getUnalignedRecordCount
  • getFirstOffset
  • getLastOffset
  • getNoCoordinateRecordCount
  • newReference
    Call for each new reference sequence encountered
  • recordMetaData
  • 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

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Menu (java.awt)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Option (scala)
  • Top Vim plugins
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