public SAMSequenceRecord getSAMSequenceRecord() { final String lengthString = this.getGenericFieldValue("length"); if (lengthString == null) throw new TribbleException("Contig " + this.getID() + " does not have a length field."); final SAMSequenceRecord record = new SAMSequenceRecord(this.getID(), Integer.valueOf(lengthString)); record.setAssembly(this.getGenericFieldValue("assembly")); record.setSequenceIndex(this.contigIndex); return record; }
public SAMSequenceRecord getSAMSequenceRecord() { final String lengthString = this.getGenericFieldValue("length"); if (lengthString == null) throw new TribbleException("Contig " + this.getID() + " does not have a length field."); final SAMSequenceRecord record = new SAMSequenceRecord(this.getID(), Integer.valueOf(lengthString)); record.setAssembly(this.getGenericFieldValue("assembly")); record.setSequenceIndex(this.contigIndex); return record; }
@Test public void testGetSAMString() { final SAMSequenceRecord r = new SAMSequenceRecord("chr5_but_without_a_prefix", 271828); r.setSpecies("Psephophorus terrypratchetti"); r.setAssembly("GRCt01"); r.setMd5("7a6dd3d307de916b477e7bf304ac22bc"); Assert.assertEquals("@SQ\tSN:chr5_but_without_a_prefix\tLN:271828\tSP:Psephophorus terrypratchetti\tAS:GRCt01\tM5:7a6dd3d307de916b477e7bf304ac22bc", r.getSAMString()); }
for (ReferenceInfo ri : references) { SAMSequenceRecord sr = fileHeader.getSequence(ri.reference.getName()); sr.setAssembly(ri.referenceSet.getAssemblyId()); sr.setSpecies(String.valueOf(ri.reference.getNcbiTaxonId())); sr.setAttribute(SAMSequenceRecord.URI_TAG, ri.reference.getSourceUri());
for (ReferenceInfo ri : references) { SAMSequenceRecord sr = fileHeader.getSequence(ri.reference.getName()); sr.setAssembly(ri.referenceSet.getAssemblyId()); sr.setSpecies(String.valueOf(ri.reference.getNcbiTaxonId())); sr.setAttribute(SAMSequenceRecord.URI_TAG, ri.reference.getSourceUri());