/** * Creates a new {@link VariantExporter} for the current backend. * The default implementation iterates locally through the database. * * @param metadataFactory metadataFactory * @return new VariantExporter * @throws StorageEngineException if there is an error creating the VariantExporter */ protected VariantExporter newVariantExporter(VariantMetadataFactory metadataFactory) throws StorageEngineException { return new VariantExporter(this, metadataFactory); }
/** * Read the {@link VariantFileMetadata} from a variant file. * * Accepted formats: Avro, Json and VCF * * @param input Input variant file (avro, json, vcf) * @return Read {@link VariantFileMetadata} * @throws StorageEngineException if the format is not valid or there is an error reading */ public static VariantFileMetadata readVariantFileMetadata(Path input) throws StorageEngineException { return readVariantFileMetadata(input, null); }
public MongoDBVariantStoragePipeline(StorageConfiguration configuration, String storageEngineId, VariantMongoDBAdaptor dbAdaptor) { super(configuration, storageEngineId, dbAdaptor, new VariantReaderUtils()); this.dbAdaptor = dbAdaptor; }
/** * Get a variant data reader depending on the type of the input file. * * @param input Stream Input variant file (avro, json, vcf) * @return VariantReader * @throws StorageEngineException if the format is not valid or there is an error reading */ public static VariantReader getVariantReader(Path input) throws StorageEngineException { return getVariantReader(input, null); }
public static OutputStream getOutputStream(String output, String outputFormatStr) throws IOException { VariantOutputFormat outputFormat = toOutputFormat(outputFormatStr, output); return getOutputStream(output, outputFormat); }
public void importData(URI inputUri) throws StorageEngineException, IOException { VariantMetadataImporter metadataImporter = new VariantMetadataImporter(); VariantMetadata metadata = metadataImporter.importMetaData(inputUri, dbAdaptor.getStudyConfigurationManager()); importData(inputUri, metadata); }
public static VariantVcfHtsjdkReader getVariantVcfReader(Path input, VariantStudyMetadata metadata) { return getVariantVcfReader(input, metadata, false); }
public static String getOriginalFromTransformedFile(URI input) { return getOriginalFromTransformedFile(getFileName(input)); }
public static VcfDataWriter<VariantProto.Variant> newWriterForProto(VariantMetadata metadata, List<String> annotations, OutputStream outputStream) { return new VariantProtoVcfDataWriter(metadata, annotations, outputStream); }
public static VcfDataWriter<Variant> newWriterForAvro(VariantMetadata metadata, List<String> annotations, OutputStream outputStream) { return new VariantVcfDataWriter(metadata, annotations, outputStream); }
public int checkExportedVCF(Path originalVcf, Path exportedVcf, Region region) throws IOException { return checkExportedVCF(originalVcf, null, exportedVcf, region, null); }
public Map<String, Variant> readVCF(Path vcfPath, Region region) throws IOException { return readVCF(vcfPath, null, region); }
/** * Read the {@link VariantFileMetadata} from a variant file. * * Accepted formats: Avro, Json and VCF * * @param input Input variant file (avro, json, vcf) * @param metadata {@link VariantFileMetadata} to fill. Can be null * @return Read {@link VariantFileMetadata} * @throws StorageEngineException if the format is not valid or there is an error reading */ public static VariantFileMetadata readVariantFileMetadata(Path input, VariantFileMetadata metadata) throws StorageEngineException { return readVariantFileMetadata(input, metadata, false); }
/** * Get a variant data reader depending on the type of the input file. * * @param input Stream Input variant file (avro, json, vcf) * @param metadata Optional VariantSource * @return VariantReader * @throws StorageEngineException if the format is not valid or there is an error reading */ public static VariantReader getVariantReader(Path input, VariantStudyMetadata metadata) throws StorageEngineException { return getVariantReader(input, metadata, false); }
public VariantReaderUtils getVariantReaderUtils() { return new VariantReaderUtils(); }
public static boolean isAvro(String fileName) { return hasFormat(fileName, "avro"); }
public static boolean isProto(String fileName) { return hasFormat(fileName, "proto"); }
public static boolean isJson(String fileName) { return hasFormat(fileName, "json"); }