本文整理汇总了Java中htsjdk.samtools.SAMRecord.SAMTagAndValue方法的典型用法代码示例。如果您正苦于以下问题:Java SAMRecord.SAMTagAndValue方法的具体用法?Java SAMRecord.SAMTagAndValue怎么用?Java SAMRecord.SAMTagAndValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMRecord
的用法示例。
在下文中一共展示了SAMRecord.SAMTagAndValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transfer
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
/**
* Write the record.
*
* @param alignment SAMRecord.
*/
public BasicSamRecord transfer(final SAMRecord alignment) {
String readName = alignment.getReadName();
int flags = alignment.getFlags();
int contigId = alignment.getReferenceIndex();
if (contigId == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
contigId = FAKE_CONTIG_ID;
}
String contigName = alignment.getReferenceName();
int position = alignment.getAlignmentStart();
int mapQ = alignment.getMappingQuality();
String cigar = alignment.getCigarString();
int mateContigId = alignment.getMateReferenceIndex();
if (mateContigId == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
mateContigId = FAKE_CONTIG_ID;
}
String mateContigName = alignment.getMateReferenceName();
int matePosition = alignment.getMateAlignmentStart();
int inferredSize = alignment.getInferredInsertSize();
byte[] sequence = alignment.getReadString().getBytes();
byte[] quality = alignment.getBaseQualityString().getBytes();
List<SAMRecord.SAMTagAndValue> attributes = alignment.getAttributes();
List<String> encodedTags = new ArrayList<>(attributes.size());
for (SAMRecord.SAMTagAndValue attribute : attributes) {
encodedTags.add(tagCodec.encode(attribute.tag, attribute.value));
}
// 在这里统一不压缩,压缩操作是由scala代码中的执行引擎统一调配的。
return BasicSamRecord.apply(false, readName, flags, contigId, contigName, position, mapQ,
cigar, mateContigId, mateContigName, matePosition, inferredSize,
sequence, quality, encodedTags);
}
示例2: getXSTag
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
private String getXSTag(List<SAMRecord.SAMTagAndValue> list) {
String tagValue = null;
for (SAMRecord.SAMTagAndValue samTagAndValue : list) {
if (samTagAndValue.tag.equalsIgnoreCase(XS_TAG)) {
tagValue = samTagAndValue.value.toString();
}
}
return tagValue;
}
示例3: NgbSamTagAndValue
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
public NgbSamTagAndValue(SAMRecord.SAMTagAndValue tagAndValue) {
this.tag = tagAndValue.tag;
this.value = tagAndValue.value;
}
示例4: fromSAMTags
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
public static List<NgbSamTagAndValue> fromSAMTags(List<SAMRecord.SAMTagAndValue> tags) {
return tags.stream().map(NgbSamTagAndValue::new).collect(Collectors.toList());
}