start fixing test for multi cat phenotype upload.
[sgn.git] / lib / CXGN / Genotype / DownloadFactory.pm
blobb3676439028017e71d98deb5dfac17d651bf407a
1 package CXGN::Genotype::DownloadFactory;
3 =head1 NAME
5 CXGN::Genotype::DownloadFactory - an object factory to handle downloading genotypes across database. factory delegates between download types e.g. VCF, GenotypeMatrix
7 =head1 USAGE
9 my $geno = CXGN::Genotype::DownloadFactory->instantiate(
10 'VCF', #can be either 'VCF' or 'DosageMatrix'
12 bcs_schema=>$schema,
13 people_schema=>$people_schema,
14 cache_root_dir=>$cache_root,
15 accession_list=>$accession_list,
16 tissue_sample_list=>$tissue_sample_list,
17 trial_list=>$trial_list,
18 protocol_id_list=>$protocol_id_list,
19 markerprofile_id_list=>$markerprofile_id_list,
20 genotype_data_project_list=>$genotype_data_project_list,
21 chromosome_list=>\@chromosome_numbers,
22 start_position=>$start_position,
23 end_position=>$end_position,
24 marker_name_list=>['S80_265728', 'S80_265723'],
25 genotypeprop_hash_select=>['DS', 'GT', 'DP'], #THESE ARE THE KEYS IN THE GENOTYPEPROP OBJECT
26 protocolprop_top_key_select=>['reference_genome_name', 'header_information_lines', 'marker_names', 'markers'], #THESE ARE THE KEYS AT THE TOP LEVEL OF THE PROTOCOLPROP OBJECT
27 protocolprop_marker_hash_select=>['name', 'chrom', 'pos', 'alt', 'ref'], #THESE ARE THE KEYS IN THE MARKERS OBJECT IN THE PROTOCOLPROP OBJECT
28 limit=>$limit,
29 offset=>$offset,
30 compute_from_parents=>0, #If you want to compute the genotype for accessions given from parents in the pedigree. Useful for hybrids where parents are genotyped.
31 forbid_cache=>0, #If you want to get a guaranteed fresh result not from the file cache
32 prevent_transpose=>0, #Prevent transpose of DosageMatrix
33 return_only_first_genotypeprop_for_stock=>1
36 my $status = $geno->download();
38 =head1 DESCRIPTION
41 =head1 AUTHORS
43 Nicolas Morales <nm529@cornell.edu>
45 =cut
47 use strict;
48 use warnings;
50 sub instantiate {
51 my $class = shift;
52 my $type = shift;
53 my $location = "CXGN/Genotype/Download/$type.pm";
54 my $obj_class = "CXGN::Genotype::Download::$type";
55 require $location;
56 return $obj_class->new(@_);