|
|
@@ -25,14 +25,17 @@ |
|
|
package htsjdk.samtools.util;
|
|
|
|
|
|
import htsjdk.samtools.SAMFileHeader;
|
|
|
+import htsjdk.samtools.SAMSequenceDictionary;
|
|
|
import htsjdk.samtools.SAMSequenceRecord;
|
|
|
+import htsjdk.samtools.SamFileHeaderMerger;
|
|
|
import htsjdk.variant.vcf.VCFFileReader;
|
|
|
import org.testng.Assert;
|
|
|
import org.testng.annotations.BeforeTest;
|
|
|
import org.testng.annotations.DataProvider;
|
|
|
import org.testng.annotations.Test;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
@@ -75,6 +78,15 @@ public IntervalListTest() { |
|
|
list3.add(new Interval("3", 50, 470));
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testIntervalListFrom() {
|
|
|
+ final String testPath = "src/test/resources/htsjdk/samtools/intervallist/IntervalListFromVCFTestComp.interval_list";
|
|
|
+ final IntervalList fromFileList = IntervalList.fromFile(new File(testPath));
|
|
|
+ final IntervalList fromPathList = IntervalList.fromPath(Paths.get(testPath));
|
|
|
+ fromFileList.getHeader().getSequenceDictionary().assertSameDictionary(fromPathList.getHeader().getSequenceDictionary());
|
|
|
+ Assert.assertEquals(CollectionUtil.makeCollection(fromFileList.iterator()), CollectionUtil.makeCollection(fromPathList.iterator()));
|
|
|
+ }
|
|
|
+
|
|
|
@DataProvider(name = "intersectData")
|
|
|
public Object[][] intersectData() {
|
|
|
final IntervalList intersect123 = new IntervalList(fileHeader);
|
|
|
|
You might want to use the more ugly path.toUri().toString() because the path.toString() tends to drop the scheme.