Package net.sf.samtools

Examples of net.sf.samtools.SAMReadGroupRecord


  public Sam2CramRecordFactory(byte[] refBases, SAMFileHeader samFileHeader) {
    this.refBases = refBases;

    List<SAMReadGroupRecord> readGroups = samFileHeader.getReadGroups();
    for (int i = 0; i < readGroups.size(); i++) {
      SAMReadGroupRecord readGroupRecord = readGroups.get(i);
      readGroupMap.put(readGroupRecord.getId(), i);
    }
  }
View Full Code Here


    cramRecord.setMappingQuality(record.getMappingQuality());
    cramRecord.setDuplicate(record.getDuplicateReadFlag());

    cramRecord.templateSize = record.getInferredInsertSize();

    SAMReadGroupRecord readGroup = record.getReadGroup();
    Integer rgIndex = 0;
    if (readGroup != null)
//      rgIndex = readGroupMap.get(readGroup.getId());
      cramRecord.setReadGroupID(readGroupMap.get(readGroup.getId()));
    else
      cramRecord.setReadGroupID(-1);
//      rgIndex = readGroupMap.get(UNKNOWN_READ_GROUP_ID);

//    if (rgIndex == null)
View Full Code Here

      for (ReadTag tag : cramRecord.tags)
        samRecord.setAttribute(tag.getKey(), tag.getValue());

    if (cramRecord.getReadGroupID() > -1) {
//    if (cramRecord.getReadGroupID() < header.getReadGroups().size()) {
      SAMReadGroupRecord readGroupRecord = header.getReadGroups().get(
          cramRecord.getReadGroupID());
      samRecord.setAttribute("RG", readGroupRecord.getId());
    }

    return samRecord;
  }
View Full Code Here

            firstSeenMates.put(currentReadName, currentRecord) ;
        }
        else {
            assertPairedMates(firstRecord, currentRecord);

            final SAMReadGroupRecord readGroup = currentRecord.getReadGroup();
            List<FastqWriter> writerPair;
            writerPair = writers.get(readGroup);
            if(writerPair == null)
            {
                final File fq1 = makeReadGroupFile(readGroup, "_1");
View Full Code Here

            }
        }
    }

    protected void doGroupedUnpaired(final Map<SAMReadGroupRecord, List<FastqWriter>> writers, final SAMRecord currentRecord) {
        final SAMReadGroupRecord readGroup = currentRecord.getReadGroup();
        final SAMFileReader reader = new SAMFileReader(IoUtil.openFileForReading(INPUT));

        List<FastqWriter> writerList = writers.get(readGroup);
        if(writerList == null){
            final File fq1 = makeReadGroupFile(readGroup, null);
View Full Code Here

TOP

Related Classes of net.sf.samtools.SAMReadGroupRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.