@Override public final SAMSequenceRecord clone() { final SAMSequenceRecord ret = new SAMSequenceRecord(this.mSequenceName, this.mSequenceLength); ret.mSequenceIndex = this.mSequenceIndex; for (final Map.Entry<String, String> entry : this.getAttributes()) { ret.setAttribute(entry.getKey(), entry.getValue()); } return ret; }
@Override public final SAMSequenceRecord clone() { final SAMSequenceRecord ret = new SAMSequenceRecord(this.mSequenceName, this.mSequenceLength); ret.mSequenceIndex = this.mSequenceIndex; for (final Map.Entry<String, String> entry : this.getAttributes()) { ret.setAttribute(entry.getKey(), entry.getValue()); } return ret; }
public final SAMSequenceRecord clone() { final SAMSequenceRecord ret = new SAMSequenceRecord(this.mSequenceName, this.mSequenceLength); ret.mSequenceIndex = this.mSequenceIndex; for (final Map.Entry<String, String> entry : this.getAttributes()) { ret.setAttribute(entry.getKey(), entry.getValue()); } return ret; }
protected String getSQLine(final SAMSequenceRecord sequenceRecord) { final int numAttributes = sequenceRecord.getAttributes() != null ? sequenceRecord.getAttributes().size() : 0; final String[] fields = new String[3 + numAttributes]; fields[0] = HEADER_LINE_START + HeaderRecordType.SQ; fields[1] = SAMSequenceRecord.SEQUENCE_NAME_TAG + TAG_KEY_VALUE_SEPARATOR + sequenceRecord.getSequenceName(); fields[2] = SAMSequenceRecord.SEQUENCE_LENGTH_TAG + TAG_KEY_VALUE_SEPARATOR + Integer.toString(sequenceRecord.getSequenceLength()); encodeTags(sequenceRecord, fields, 3); return StringUtil.join(FIELD_SEPARATOR, fields); }
protected String getSQLine(final SAMSequenceRecord sequenceRecord) { final int numAttributes = sequenceRecord.getAttributes() != null ? sequenceRecord.getAttributes().size() : 0; final String[] fields = new String[3 + numAttributes]; fields[0] = HEADER_LINE_START + HeaderRecordType.SQ; fields[1] = SAMSequenceRecord.SEQUENCE_NAME_TAG + TAG_KEY_VALUE_SEPARATOR + sequenceRecord.getSequenceName(); fields[2] = SAMSequenceRecord.SEQUENCE_LENGTH_TAG + TAG_KEY_VALUE_SEPARATOR + Integer.toString(sequenceRecord.getSequenceLength()); encodeTags(sequenceRecord, fields, 3); return StringUtil.join(FIELD_SEPARATOR, fields); }
private void writeSQLine(final SAMSequenceRecord sequenceRecord) { final int numAttributes =sequenceRecord.getAttributes() != null ? sequenceRecord.getAttributes().size() : 0; final String[] fields = new String[3 + numAttributes]; fields[0] = HEADER_LINE_START + HeaderRecordType.SQ; fields[1] = SAMSequenceRecord.SEQUENCE_NAME_TAG + TAG_KEY_VALUE_SEPARATOR + sequenceRecord.getSequenceName(); fields[2] = SAMSequenceRecord.SEQUENCE_LENGTH_TAG + TAG_KEY_VALUE_SEPARATOR + Integer.toString(sequenceRecord.getSequenceLength()); encodeTags(sequenceRecord, fields, 3); println(StringUtil.join(FIELD_SEPARATOR, fields)); }
String s1Attrs = ""; for (final java.util.Map.Entry<String, String> entry : s1.get(i) .getAttributes()) { s1Attrs += "/" + entry.getKey() + "=" + entry.getValue(); .getAttributes()) { s2Attrs += "/" + entry.getKey() + "=" + entry.getValue();
String s1Attrs = ""; for (final java.util.Map.Entry<String, String> entry : s1.get(i) .getAttributes()) { s1Attrs += "/" + entry.getKey() + "=" + entry.getValue(); .getAttributes()) { s2Attrs += "/" + entry.getKey() + "=" + entry.getValue();
String s1Attrs = ""; for (final java.util.Map.Entry<String, String> entry : s1.get(i) .getAttributes()) { s1Attrs += "/" + entry.getKey() + "=" + entry.getValue(); .getAttributes()) { s2Attrs += "/" + entry.getKey() + "=" + entry.getValue();
s1.getAttributes().forEach(a -> allTags.add(a.getKey())); s2.getAttributes().forEach(a -> allTags.add(a.getKey()));
s1.getAttributes().forEach(a -> allTags.add(a.getKey())); s2.getAttributes().forEach(a -> allTags.add(a.getKey()));
for (Map.Entry<String,String> entry :sq.getAttributes()){ attr.put(entry.getKey(), entry.getValue());
public static void checkRefMD5(SAMSequenceDictionary d, ReferenceSequenceFile refFile, boolean checkExistingMD5, boolean failIfMD5Mismatch) throws NoSuchAlgorithmException { for (SAMSequenceRecord r : d.getSequences()) { ReferenceSequence sequence = refFile.getSequence(r.getSequenceName()); if (!r.getAttributes().contains(SAMSequenceRecord.MD5_TAG)) { String md5 = calculateMD5String(sequence.getBases()); r.setAttribute(SAMSequenceRecord.MD5_TAG, md5); } else { if (checkExistingMD5) { String existingMD5 = r.getAttribute(SAMSequenceRecord.MD5_TAG); String md5 = calculateMD5String(sequence.getBases()); if (!md5.equals(existingMD5)) { String message = String.format("For sequence %s the md5 %s does not match the actual md5 %s.", r.getSequenceName(), existingMD5, md5); if (failIfMD5Mismatch) throw new RuntimeException(message); else log.warn(message); } } } } }