Skip to content
Commits on Source (8)
......@@ -10,6 +10,7 @@ src/htsjdk.iml
*.iml
*.ipr
*.iws
out/
......
htsjdk (2.12.0+dfsg-1) UNRELEASED; urgency=medium
htsjdk (2.14.3+dfsg-1) UNRELEASED_targeting_experimental; urgency=medium
[ Andreas Tille ]
* New upstream version
Closes: #894289 (FIXME: check this!)
* cme fix dpkg-control
* Standards-Version: 4.1.1
* Standards-Version: 4.1.3
[ Olivier Sallou ]
* d/patches/30-disable-scalatest.patch
Disable scala testing as scalatest is not available in Debian yet
......@@ -10,9 +13,7 @@ htsjdk (2.12.0+dfsg-1) UNRELEASED; urgency=medium
Disable unit testing due to gradle+testng errors in gradle 3.2
gradle 3.4 will fix the problem
WARNING: htsjdk 2.12 breaks API and is not compatible with picard-tools 2.8.1
-- Andreas Tille <tille@debian.org> Wed, 01 Nov 2017 09:09:56 +0000
-- Andreas Tille <tille@debian.org> Wed, 28 Mar 2018 14:19:04 +0200
htsjdk (2.8.1+dfsg-2) unstable; urgency=medium
......
......@@ -24,7 +24,7 @@ Build-Depends: default-jdk (>= 2:1.8),
junit4,
libjimfs-java,
scala-library
Standards-Version: 4.1.1
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/htsjdk.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/htsjdk.git
Homepage: http://samtools.github.io/htsjdk/
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.samtools</groupId>
<artifactId>htsjdk</artifactId>
<version>2.5.0</version>
<version>2.14.3</version>
<name>HTSJDK</name>
<description>A Java API for high-throughput sequencing data (HTS) formats</description>
<url>http://samtools.github.io/htsjdk/</url>
......@@ -27,18 +27,36 @@
<url>git@github.com:samtools/htsjdk.git</url>
</scm>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl</artifactId>
<version>2.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>gov.nih.nlm.ncbi</groupId>
<artifactId>ngs-java</artifactId>
......@@ -46,10 +64,16 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.5</version>
<scope>compile</scope>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.12</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
......@@ -58,16 +82,16 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl</artifactId>
<version>2.1.1</version>
<scope>compile</scope>
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.0.3-rc3</version>
<scope>compile</scope>
<groupId>org.pegdown</groupId>
<artifactId>pegdown</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.51
iQEcBAABAgAGBQJXbAblAAoJEITtsafE4WjVo9cH+gNiTfe8g3i4FcvYmajoGsg7
pSqyqDgyQZaF9A/Q0vnZVAvmFFA0iwbYL5XBpeOGqNhtWDKE3pyeq3GL6bsUFr/V
YgcFESd8Rk1MVw+62cGAV805flxJpVPanh7eRRA/Fqf/LxqnVxPqoDWXGnY09qLi
p5yvAfDrI0nyFuUpxew1pnITRq/CpfgeM2uBTcBjQBeKZQgPaX6iRcs+3krZMvF9
0p+X+f7MAapqB+u6niLuH3rFBhTn7UVYRQCvPOlvYk2+LvYDtT4f9mxuHeKgzM3W
W8xU5EHqf8noh7T/l1qHJq0z9Fd5rb/kOTxtlFYRE5WB/L4oLHFRPWagCfuMujY=
=jlsl
iQIcBAABAgAGBQJafMM1AAoJEHqkTkuxf2donbAP/1ntOikZk6SBuYr58gnLUkKW
Ll7ptC6YdsqkshTo8DS/Ize5s5IKuyILMD7D/mz+yECt/wdWuySzfwmKYj3nnMhy
ksU6qfoqYICL4PJUx6l30vwJfjgSyQM2Q6frKEiPWOQ21sEa+DTzf10WriEi8lzU
9igEn6sYIEdfCBspUbgTNTz44oeyspZoJMKE21GhVI+fPlUxSpQdSxBz2a9K4NJd
aumrq4dvBR0+vrLhe/TBVjJo/yDEWXkfzvAPu8E/Uym5SlTSk0IRdz5RCJ6zHMVn
6Mk3t1Un+MNizJ6qBtt32a1GXig7ZA9TJ591N0qRmhMpVBkGVtPPrmeLMypmStv+
wE7LZVcWFvL7OgTk6yFBGCxqIbyBGcfRZod3VSn+rUCO77myqZeYRINJGS7zC6dt
qPRy99hYM+Zi7OHWMnPXUwg1r2ddRbnRlnalIrwJ/w/jmuvPyKZCH9pCF+Px3qAC
qbdhECajCC9J7HgoUUmoqCzsbwGyT4/WIk3OBjLtq3lA2/S03sKF6/efXZ0loRrJ
UUquOAezw9O8Osds4tCbAD3vb3/Y3k9ICGGLRzHexTGm6xQaLZxdlSvHdkdhj96L
5EFQD1P9nj/mf1LbA0BSQVfuYeYvTSIz+vw+AUx6ums2HIFUZyTQBLhgdG7Qyvgk
Z+BH1id17u9euVB7Gnhp
=sAvZ
-----END PGP SIGNATURE-----
This diff is collapsed.
......@@ -6,7 +6,7 @@ Forwarded: not-needed
Last-Updated: 2017-10-18
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@
@@ -6,7 +6,7 @@ buildscript {
plugins {
id 'java'
......@@ -15,7 +15,7 @@ Last-Updated: 2017-10-18
id 'maven'
id 'signing'
}
@@ -23,11 +23,11 @@
@@ -23,11 +23,11 @@ dependencies {
compile "org.tukaani:xz:1.5"
compile "gov.nih.nlm.ncbi:ngs-java:1.2.4"
......@@ -32,7 +32,7 @@ Last-Updated: 2017-10-18
}
sourceCompatibility = 1.8
@@ -90,22 +90,20 @@
@@ -90,22 +90,20 @@ test {
jvmArgs += '-Dsamjdk.sra_libraries_download=true'
}
......
......@@ -29,7 +29,6 @@ import htsjdk.samtools.util.IOUtil;
import htsjdk.samtools.util.RuntimeIOException;
import htsjdk.samtools.util.zip.DeflaterFactory;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
......@@ -37,7 +36,6 @@ import java.io.StringWriter;
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* Concrete implementation of SAMFileWriter for writing gzipped BAM files.
......@@ -51,37 +49,37 @@ class BAMFileWriter extends SAMFileWriterImpl {
protected BAMFileWriter(final File path) {
blockCompressedOutputStream = new BlockCompressedOutputStream(path);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(path.getAbsolutePath());
}
protected BAMFileWriter(final File path, final int compressionLevel) {
blockCompressedOutputStream = new BlockCompressedOutputStream(path, compressionLevel);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(path.getAbsolutePath());
}
protected BAMFileWriter(final OutputStream os, final File file) {
blockCompressedOutputStream = new BlockCompressedOutputStream(os, file);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(getPathString(file));
}
protected BAMFileWriter(final OutputStream os, final File file, final int compressionLevel) {
blockCompressedOutputStream = new BlockCompressedOutputStream(os, file, compressionLevel);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(getPathString(file));
}
protected BAMFileWriter(final OutputStream os, final File file, final int compressionLevel, final DeflaterFactory deflaterFactory) {
blockCompressedOutputStream = new BlockCompressedOutputStream(os, file, compressionLevel, deflaterFactory);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(getPathString(file));
}
protected BAMFileWriter(final OutputStream os, final String absoluteFilename, final int compressionLevel, final DeflaterFactory deflaterFactory) {
blockCompressedOutputStream = new BlockCompressedOutputStream(os, null, compressionLevel, deflaterFactory);
outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
outputBinaryCodec.setOutputFileName(absoluteFilename);
}
......@@ -204,7 +202,7 @@ class BAMFileWriter extends SAMFileWriterImpl {
protected static void writeHeader(final OutputStream outputStream, final SAMFileHeader samFileHeader) {
final BlockCompressedOutputStream blockCompressedOutputStream = new BlockCompressedOutputStream(outputStream, null);
final BinaryCodec outputBinaryCodec = new BinaryCodec(new DataOutputStream(blockCompressedOutputStream));
final BinaryCodec outputBinaryCodec = new BinaryCodec(blockCompressedOutputStream);
writeHeader(outputBinaryCodec, samFileHeader);
try {
blockCompressedOutputStream.flush();
......
......@@ -110,7 +110,7 @@ public class Defaults {
}
REFERENCE_FASTA = getFileProperty("reference_fasta", null);
USE_CRAM_REF_DOWNLOAD = getBooleanProperty("use_cram_ref_download", false);
EBI_REFERENCE_SERVICE_URL_MASK = "http://www.ebi.ac.uk/ena/cram/md5/%s";
EBI_REFERENCE_SERVICE_URL_MASK = "https://www.ebi.ac.uk/ena/cram/md5/%s";
CUSTOM_READER_FACTORY = getStringProperty("custom_reader", "");
SAM_FLAG_FIELD_FORMAT = SamFlagField.valueOf(getStringProperty("sam_flag_field_format", SamFlagField.DECIMAL.name()));
SRA_LIBRARIES_DOWNLOAD = getBooleanProperty("sra_libraries_download", false);
......
......@@ -53,7 +53,7 @@ public class DownsamplingIteratorFactory {
"strategy to finish. Works in a single pass, and will provide accuracy close to (but often not as good as) HighAccuracy while requiring " +
"memory proportional to the set of reads emitted from the ConstantMemory strategy to the HighAccuracy strategy. Works well when downsampling " +
"large inputs to small proportions (e.g. downsampling hundreds of millions of reads and retaining only 2%. Should be accurate 99.9% of the time " +
"when the input contains >= 50,000 templates (read names). For smaller inputs, HighAccuracy is recommended instead.";
"when the input contains more than 50,000 templates (read names). For smaller inputs, HighAccuracy is recommended instead.";
/** Describes the available downsampling strategies. */
public enum Strategy {
......
......@@ -24,39 +24,17 @@
package htsjdk.samtools;
import htsjdk.samtools.util.CloseableIterator;
import htsjdk.samtools.util.PeekIterator;
/**
* Wrapper around SAMRecord iterator that skips over non-primary elements.
* This iterator conflates a filtering iterator and a peekable iterator. It would be cleaner to
* handle those concerns separately.
* @deprecated use {@link SecondaryAlignmentSkippingIterator} instead.
*/
public class NotPrimarySkippingIterator {
private final PeekIterator<SAMRecord> it;
@Deprecated
public class NotPrimarySkippingIterator extends SecondaryAlignmentSkippingIterator {
public NotPrimarySkippingIterator(final CloseableIterator<SAMRecord> underlyingIt) {
it = new PeekIterator<SAMRecord>(underlyingIt);
skipAnyNotprimary();
}
public boolean hasCurrent() {
return it.hasNext();
}
public SAMRecord getCurrent() {
assert(hasCurrent());
return it.peek();
}
public boolean advance() {
it.next();
skipAnyNotprimary();
return hasCurrent();
}
private void skipAnyNotprimary() {
while (it.hasNext() && it.peek().getNotPrimaryAlignmentFlag()) {
it.next();
}
public NotPrimarySkippingIterator(CloseableIterator<SAMRecord> underlyingIt) {
super(underlyingIt);
}
}
......@@ -148,9 +148,11 @@ public class SAMFileHeader extends AbstractSAMHeaderRecord
/**
* Look up sequence record by name.
* @return sequence record if it's found by name,
* or null if sequence dictionary is empty or if the sequence is not found in the dictionary.
*/
public SAMSequenceRecord getSequence(final String name) {
return mSequenceDictionary.getSequence(name);
return mSequenceDictionary == null ? null : mSequenceDictionary.getSequence(name);
}
/**
......
......@@ -32,7 +32,6 @@ import htsjdk.samtools.util.RuntimeIOException;
import htsjdk.samtools.util.zip.DeflaterFactory;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
......@@ -300,7 +299,7 @@ public class SAMFileWriterFactory implements Cloneable {
if (this.useAsyncIo) return new AsyncSAMFileWriter(ret, this.asyncOutputBufferSize);
else return ret;
} catch (final IOException ioe) {
throw new RuntimeIOException("Error opening file: " + outputPath.toUri());
throw new RuntimeIOException("Error opening file: " + outputPath.toUri(), ioe);
}
}
......@@ -352,7 +351,7 @@ public class SAMFileWriterFactory implements Cloneable {
samFlagFieldOutput);
return initWriter(header, presorted, ret);
} catch (final IOException ioe) {
throw new RuntimeIOException("Error opening file: " + outputPath.toUri());
throw new RuntimeIOException("Error opening file: " + outputPath.toUri(), ioe);
}
}
......@@ -588,7 +587,7 @@ public class SAMFileWriterFactory implements Cloneable {
indexOS = Files.newOutputStream(indexPath);
}
catch (final IOException ioe) {
throw new RuntimeIOException("Error creating index file for: " + indexPath.toUri());
throw new RuntimeIOException("Error creating index file for: " + indexPath.toUri(), ioe);
}
}
}
......@@ -597,7 +596,7 @@ public class SAMFileWriterFactory implements Cloneable {
cramOS = IOUtil.maybeBufferOutputStream(Files.newOutputStream(outputFile), bufferSize);
}
catch (final IOException ioe) {
throw new RuntimeIOException("Error creating CRAM file: " + outputFile.toUri());
throw new RuntimeIOException("Error creating CRAM file: " + outputFile.toUri(), ioe);
}
final Path md5Path = IOUtil.addExtension(outputFile, ".md5");
......
......@@ -39,6 +39,9 @@ public enum SAMFlag {
MATE_REVERSE_STRAND( 0x20, "SEQ of the next segment in the template being reverse complemented"),
FIRST_OF_PAIR( 0x40, "The first segment in the template"),
SECOND_OF_PAIR( 0x80, "The last segment in the template"),
SECONDARY_ALIGNMENT( 0x100, "Secondary alignment"),
/** @deprecated use {@link #SECONDARY_ALIGNMENT} instead. */
@Deprecated
NOT_PRIMARY_ALIGNMENT( 0x100, "Secondary alignment"),
READ_FAILS_VENDOR_QUALITY_CHECK(0x200, "Not passing quality controls"),
DUPLICATE_READ( 0x400, "PCR or optical duplicate"),
......
......@@ -967,9 +967,18 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
/**
* the alignment is not primary (a read having split hits may have multiple primary alignment records).
* @deprecated use {@link #isSecondaryAlignment()} instead.
*/
@Deprecated
public boolean getNotPrimaryAlignmentFlag() {
return (mFlags & SAMFlag.NOT_PRIMARY_ALIGNMENT.flag) != 0;
return isSecondaryAlignment();
}
/**
* the alignment is secondary (a read having slipt hits have multiple alignment records).
*/
public boolean isSecondaryAlignment() {
return (mFlags & SAMFlag.SECONDARY_ALIGNMENT.flag) != 0;
}
/**
......@@ -1063,9 +1072,18 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
/**
* the alignment is not primary (a read having split hits may have multiple primary alignment records).
* @deprecated use {@link #setSecondaryAlignment(boolean)} instead.
*/
@Deprecated
public void setNotPrimaryAlignmentFlag(final boolean flag) {
setFlag(flag, SAMFlag.NOT_PRIMARY_ALIGNMENT.flag);
setSecondaryAlignment(flag);
}
/**
* the alignment is secondary (a read having slipt hits have multiple alignment records).
*/
public void setSecondaryAlignment(final boolean flag) {
setFlag(flag, SAMFlag.SECONDARY_ALIGNMENT.flag);
}
/**
......@@ -1094,7 +1112,7 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
* equivalent to {@code (getNotPrimaryAlignmentFlag() || getSupplementaryAlignmentFlag())}.
*/
public boolean isSecondaryOrSupplementary() {
return getNotPrimaryAlignmentFlag() || getSupplementaryAlignmentFlag();
return isSecondaryAlignment() || getSupplementaryAlignmentFlag();
}
private void setFlag(final boolean flag, final int bit) {
......@@ -1954,9 +1972,9 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
if (firstOnly) return ret;
}
if (getReadUnmappedFlag()) {
if (getNotPrimaryAlignmentFlag()) {
if (isSecondaryAlignment()) {
if (ret == null) ret = new ArrayList<>();
ret.add(new SAMValidationError(SAMValidationError.Type.INVALID_FLAG_NOT_PRIM_ALIGNMENT, "Not primary alignment flag should not be set for unmapped read.", getReadName()));
ret.add(new SAMValidationError(SAMValidationError.Type.INVALID_FLAG_NOT_PRIM_ALIGNMENT, "Secondary alignment flag should not be set for unmapped read.", getReadName()));
if (firstOnly) return ret;
}
if (getSupplementaryAlignmentFlag()) {
......@@ -2030,7 +2048,7 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
if (firstOnly) return ret;
}
// TODO(mccowan): Is this asking "is this the primary alignment"?
if (this.getReadLength() == 0 && !this.getNotPrimaryAlignmentFlag()) {
if (this.getReadLength() == 0 && !this.isSecondaryAlignment()) {
final Object fz = getAttribute(SAMTagUtil.getSingleton().FZ);
if (fz == null) {
final String cq = (String)getAttribute(SAMTagUtil.getSingleton().CQ);
......@@ -2083,7 +2101,7 @@ public class SAMRecord implements Cloneable, Locatable, Serializable {
if (firstOnly) return ret;
}
if (getCigar().getReadLength() != 0 && getCigar().getReadLength() != getReadLength()) {
if (getReadLength() != 0 && getCigar().getReadLength() != 0 && getCigar().getReadLength() != getReadLength()) {
if (ret == null) ret = new ArrayList<>();
ret.add(new SAMValidationError(SAMValidationError.Type.MISMATCH_CIGAR_SEQ_LENGTH,
"CIGAR covers " + getCigar().getReadLength() + " bases but the sequence is " + getReadLength() + " read bases ",
......
......@@ -51,8 +51,8 @@ public class SAMRecordQueryNameComparator implements SAMRecordComparator, Serial
if (samRecord1.getReadNegativeStrandFlag() != samRecord2.getReadNegativeStrandFlag()) {
return (samRecord1.getReadNegativeStrandFlag()? 1: -1);
}
if (samRecord1.getNotPrimaryAlignmentFlag() != samRecord2.getNotPrimaryAlignmentFlag()) {
return samRecord2.getNotPrimaryAlignmentFlag()? -1: 1;
if (samRecord1.isSecondaryAlignment() != samRecord2.isSecondaryAlignment()) {
return samRecord2.isSecondaryAlignment()? -1: 1;
}
if (samRecord1.getSupplementaryAlignmentFlag() != samRecord2.getSupplementaryAlignmentFlag()) {
return samRecord2.getSupplementaryAlignmentFlag() ? -1 : 1;
......
......@@ -25,9 +25,9 @@ package htsjdk.samtools;
import htsjdk.samtools.DuplicateScoringStrategy.ScoringStrategy;
import htsjdk.samtools.util.CloseableIterator;
import htsjdk.samtools.util.CoordMath;
import htsjdk.samtools.util.RuntimeIOException;
import htsjdk.samtools.util.SequenceUtil;
import htsjdk.samtools.util.TestUtil;
import java.io.File;
import java.io.IOException;
......@@ -58,7 +58,7 @@ public class SAMRecordSetBuilder implements Iterable<SAMRecord> {
private static final byte[] BASES = {'A', 'C', 'G', 'T'};
private static final String READ_GROUP_ID = "1";
private static final String SAMPLE = "FREE_SAMPLE";
private final Random random = new Random();
private final Random random = new Random(TestUtil.RANDOM_SEED);
private SAMFileHeader header;
private final Collection<SAMRecord> records;
......@@ -287,7 +287,7 @@ public class SAMRecordSetBuilder implements Iterable<SAMRecord> {
final boolean recordUnmapped, final String cigar, final String qualityString,
final int defaultQuality, final boolean isSecondary) throws SAMException {
final htsjdk.samtools.SAMRecord rec = createReadNoFlag(name, contig, start, negativeStrand, recordUnmapped, cigar, qualityString, defaultQuality);
if (isSecondary) rec.setNotPrimaryAlignmentFlag(true);
if (isSecondary) rec.setSecondaryAlignment(true);
this.records.add(rec);
return rec;
}
......@@ -300,7 +300,7 @@ public class SAMRecordSetBuilder implements Iterable<SAMRecord> {
final boolean recordUnmapped, final String cigar, final String qualityString,
final int defaultQuality, final boolean isSecondary, final boolean isSupplementary) throws SAMException {
final htsjdk.samtools.SAMRecord rec = createReadNoFlag(name, contig, start, negativeStrand, recordUnmapped, cigar, qualityString, defaultQuality);
if (isSecondary) rec.setNotPrimaryAlignmentFlag(true);
if (isSecondary) rec.setSecondaryAlignment(true);
if (isSupplementary) rec.setSupplementaryAlignmentFlag(true);
this.records.add(rec);
return rec;
......@@ -434,11 +434,11 @@ public class SAMRecordSetBuilder implements Iterable<SAMRecord> {
end2.setReadPairedFlag(true);
end2.setSecondOfPairFlag(true);
if (record1NonPrimary) end1.setNotPrimaryAlignmentFlag(true);
if (record2NonPrimary) end2.setNotPrimaryAlignmentFlag(true);
if (record1NonPrimary) end1.setSecondaryAlignment(true);
if (record2NonPrimary) end2.setSecondaryAlignment(true);
if (record1NonPrimary) end1.setNotPrimaryAlignmentFlag(true);
if (record2NonPrimary) end2.setNotPrimaryAlignmentFlag(true);
if (record1NonPrimary) end1.setSecondaryAlignment(true);
if (record2NonPrimary) end2.setSecondaryAlignment(true);
// set mate info
SamPairUtil.setMateInfo(end1, end2, true);
......
/*
* The MIT License
*
* Copyright (c) 2009 The Broad Institute
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package htsjdk.samtools;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
*
* @author alecw@broadinstitute.org
*
* @deprecated 10/27/2016 Use {@link SAMRecord} constants and functions
*/
@Deprecated
public class SAMRecordUtil {
/**
* @deprecated 6/5/2017 Use {@link SAMRecord#TAGS_TO_REVERSE_COMPLEMENT}
*/
@Deprecated
public static List<String> TAGS_TO_REVERSE_COMPLEMENT = Arrays.asList(SAMTag.E2.name(), SAMTag.SQ.name());
/**
* @deprecated 6/5/2017 Use {@link SAMRecord#TAGS_TO_REVERSE}
*/
@Deprecated
public static List<String> TAGS_TO_REVERSE = Arrays.asList(SAMTag.OQ.name(), SAMTag.U2.name());
/**
* Reverse-complement bases and reverse quality scores along with known optional attributes that
* need the same treatment. Changes made in-place, instead of making a copy of the bases, qualities,
* or attributes. If a copy is needed use {@link #reverseComplement(SAMRecord, boolean)}.
* See {@link #TAGS_TO_REVERSE_COMPLEMENT} {@link #TAGS_TO_REVERSE}
* for the default set of tags that are handled.
*
* @deprecated 6/5/2017 Use {@link SAMRecord#reverseComplement} but note that the default behavior there is different
* It will default to making a copy, not reverse-complementing in-place!
*/
@Deprecated
public static void reverseComplement(final SAMRecord rec) {
rec.reverseComplement(TAGS_TO_REVERSE_COMPLEMENT, TAGS_TO_REVERSE, true);
}
/**
* Reverse-complement bases and reverse quality scores along with known optional attributes that
* need the same treatment. Optionally makes a copy of the bases, qualities or attributes instead
* of altering them in-place. See {@link #TAGS_TO_REVERSE_COMPLEMENT} {@link #TAGS_TO_REVERSE}
* for the default set of tags that are handled.
*
* @param rec Record to reverse complement.
* @param inplace Setting this to false will clone all attributes, bases and qualities before changing the values.
*
* @deprecated 6/5/2017 Use {@link SAMRecord#reverseComplement}
*/
@Deprecated
public static void reverseComplement(final SAMRecord rec, boolean inplace) {
rec.reverseComplement(TAGS_TO_REVERSE_COMPLEMENT, TAGS_TO_REVERSE, inplace);
}
/**
* Reverse complement bases and reverse quality scores. In addition reverse complement any
* non-null attributes specified by tagsToRevcomp and reverse and non-null attributes
* specified by tagsToReverse.
*
* @deprecated 6/5/2017 Use {@link SAMRecord#reverseComplement}
*/
@Deprecated
public static void reverseComplement(final SAMRecord rec, final Collection<String> tagsToRevcomp, final Collection<String> tagsToReverse, boolean inplace) {
rec.reverseComplement(tagsToRevcomp, tagsToReverse, inplace);
}
}
......@@ -580,7 +580,7 @@ public final class SAMUtils {
rec.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR);
rec.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY);
rec.setInferredInsertSize(0);
rec.setNotPrimaryAlignmentFlag(false);
rec.setSecondaryAlignment(false);
rec.setSupplementaryAlignmentFlag(false);
rec.setProperPairFlag(false);
rec.setReadUnmappedFlag(true);
......