public static String prettyPrintSequenceRecords(SAMSequenceDictionary sequenceDictionary) { String[] sequenceRecordNames = new String[sequenceDictionary.size()]; int sequenceRecordIndex = 0; for (SAMSequenceRecord sequenceRecord : sequenceDictionary.getSequences()) sequenceRecordNames[sequenceRecordIndex++] = sequenceRecord.getSequenceName(); return Arrays.deepToString(sequenceRecordNames); }
private static void setIndexSequenceDictionary( final Index index, final SAMSequenceDictionary dict) { for (final SAMSequenceRecord seq : dict.getSequences()) { final String contig = SequenceDictionaryPropertyPredicate + seq.getSequenceName(); final String length = String.valueOf(seq.getSequenceLength()); index.addProperty(contig, length); } }
/** * create a list of genomic locations, given a reference sequence * * @param dict the sequence dictionary to create a collection from * @return the GenomeLocSet of all references sequences as GenomeLoc's */ public static GenomeLocSortedSet createSetFromSequenceDictionary(SAMSequenceDictionary dict) { GenomeLocParser parser = new GenomeLocParser(dict); GenomeLocSortedSet returnSortedSet = new GenomeLocSortedSet(parser); for (SAMSequenceRecord record : dict.getSequences()) { returnSortedSet.add( parser.createGenomeLoc(record.getSequenceName(), 1, record.getSequenceLength())); } return returnSortedSet; }