diff --git a/src/main/java/htsjdk/beta/io/bundle/BundleResourceType.java b/src/main/java/htsjdk/beta/io/bundle/BundleResourceType.java index cca9cb9de7..b0c4c3bd6f 100644 --- a/src/main/java/htsjdk/beta/io/bundle/BundleResourceType.java +++ b/src/main/java/htsjdk/beta/io/bundle/BundleResourceType.java @@ -5,8 +5,7 @@ import htsjdk.beta.plugin.variants.VariantsFormats; /** - * Constants for specifying tandard primary content types, secondary content types, and (optional) formats - * for resources contained in a {@link Bundle}. + * Constants for specifying standard content types and formats for resources contained in a {@link Bundle}. * * Bundles generally contain one primary resource, plus one or more secondary resources such as an index or md5 file. * Each resource has an associated content type, and optionally a format. The bundle itself has a primary content @@ -17,8 +16,8 @@ * correspond to one of the enum values in {@link htsjdk.beta.plugin.HtsContentType}, since each of these has a * corresponding {@link htsjdk.beta.plugin.HtsCodec} that handles that type of resource, such as reads or variants. * - * Secondary resources can also be any string, but the standard secondary content types are defined here, i.e., for - * primary content type "READS", a secondary content type might be "READS_INDEX". + * Secondary resource content types can also be any string, but the standard secondary content types are defined + * here, i.e., for primary content type "READS", a secondary content type might be "READS_INDEX". * * Finally, each resource in a bundle can have an optional format, which is a string that corresponds to the format * for that resource. For example, a primary content type of "READS" might have a format of "BAM". diff --git a/src/main/java/htsjdk/beta/plugin/reads/ReadsBundle.java b/src/main/java/htsjdk/beta/plugin/reads/ReadsBundle.java index 2c6d9574e0..3d2f244f14 100644 --- a/src/main/java/htsjdk/beta/plugin/reads/ReadsBundle.java +++ b/src/main/java/htsjdk/beta/plugin/reads/ReadsBundle.java @@ -47,9 +47,7 @@ public class ReadsBundle extends Bundle implements Serializabl * @param reads An {@link IOPath}-derived object that represents a source of reads. */ public ReadsBundle(final T reads) { - this(Arrays.asList(toInputResource( - BundleResourceType.CT_ALIGNED_READS, - ValidationUtils.nonNull(reads, BundleResourceType.CT_ALIGNED_READS)))); + this(Arrays.asList(toInputResource(BundleResourceType.CT_ALIGNED_READS, reads))); } /** @@ -59,10 +57,8 @@ public ReadsBundle(final T reads) { */ public ReadsBundle(final T reads, final T index) { this(Arrays.asList( - toInputResource(BundleResourceType.CT_ALIGNED_READS, ValidationUtils.nonNull(reads, BundleResourceType.CT_ALIGNED_READS)), - toInputResource( - BundleResourceType.CT_READS_INDEX, - ValidationUtils.nonNull(index, BundleResourceType.CT_READS_INDEX)))); + toInputResource(BundleResourceType.CT_ALIGNED_READS, reads), + toInputResource(BundleResourceType.CT_READS_INDEX, index))); } /** @@ -174,10 +170,6 @@ public static ReadsBundle resolveIndex( return new ReadsBundle<>(reads); } - public static boolean looksLikeAReadsBundle(final IOPath rawReadPath) { - return rawReadPath.getURI().getPath().endsWith(BundleJSON.BUNDLE_EXTENSION); - } - private static IOPathResource toInputResource(final String providedContentType, final T ioPath) { ValidationUtils.nonNull(ioPath, "ioPath"); final Optional> typePair = getInferredContentTypes(ioPath);