lib/bio/PolyploidTools/ExonContainer.rb in bio-polyploid-tools-0.1.0 vs lib/bio/PolyploidTools/ExonContainer.rb in bio-polyploid-tools-0.2.3
- old
+ new
@@ -15,24 +15,24 @@
@snp_map = Hash.new
@snp_contigs
end
def gene_models(path)
- @gene_models_db = Bio::DB::Fasta::FastaFile.new(path)
+ @gene_models_db = Bio::DB::Fasta::FastaFile.new({:fasta=>path})
@gene_models_path = path
end
- #Retunrs the sequence for a region in the gene models (exon)
+ #Returns the sequence for a region in the gene models (exon)
def gene_model_sequence(region)
seq=@gene_models_db.fetch_sequence(region)
end
#Sets the reference file for the gene models
def chromosomes(path)
- @chromosomes_db = Bio::DB::Fasta::FastaFile.new(path)
+ @chromosomes_db = Bio::DB::Fasta::FastaFile.new({:fasta=>path})
@chromosomes_path = path
end
#Retunrs the sequence for a region in the gene models (exon)
def chromosome_sequence(region)
@@ -52,11 +52,11 @@
def add_chromosome_arm(opts)
@chromosomes = Hash.new unless @chromosomes
name = opts[:name]
path = opts[:reference_path]
path = opts[:alig_path]
- chromosomes[name] = Bio::DB::Fasta::FastaFile.new(path)
+ chromosomes[name] = Bio::DB::Fasta::FastaFile.new({:fasta=>path})
end
def add_snp(snp)
@snp_map[snp.gene] = Array.new unless @snp_map[snp.gene]
@snp_map[snp.gene] << snp
@@ -117,14 +117,15 @@
def print_fasta_snp_exones (file)
@missing_exons = Set.new unless @missing_exons
@snp_map.each do | gene, snp_array|
snp_array.each do |snp|
#file.puts snp.primer_fasta_string
+
begin
file.puts snp.aligned_sequences_fasta
rescue Exception=>e
@missing_exons << snp.to_s
-# $stderr.puts e.to_s
+ $stderr.puts e.to_s
end
end
end
end
\ No newline at end of file