lib/seqtrimnext/classes/params.rb in seqtrimnext-2.0.33 vs lib/seqtrimnext/classes/params.rb in seqtrimnext-2.0.35
- old
+ new
@@ -10,10 +10,11 @@
def initialize(path)
@params = {}
@comments = {}
# @param_order={}
@mids = {}
+ @ab_adapters={}
@linkers = {}
@clusters = {}
@plugin_comments = {}
@@ -52,32 +53,40 @@
end
end
end# end def
- # Load mid's file
- def load_mids(path_file)
+ def load_db_fastas(path_file)
+ res={}
if File.exists?(path_file)
ff = FastaFile.new(path_file)
ff.each {|n,f|
# @mid_sizes[n]=f.size
- @mids[n]=f
+ res[n]=f
}
ff.close
end
+ return res
end
# Load mid's file
+ def load_mids(path_file)
+ @mids=load_db_fastas(path_file)
+ # puts @mids
+ end
+
+ # Load ab_adapters file
+ def load_ab_adapters(path_file)
+ @ab_adapters=load_db_fastas(path_file)
+ # puts @ab_adapters
+ end
+
+ # Load mid's file
def load_linkers(path_file)
- if File.exists?(path_file)
- ff = FastaFile.new(path_file)
- ff.each {|n,f|
- @linkers[n]=f
- }
- ff.close
- end
+ @linkers=load_db_fastas(path_file)
+ # puts @linkers
end
def load_repeated_seqs(file_path)
@clusters={}
@@ -88,11 +97,11 @@
#puts line,line[0]
# en ruby19 line[0] da el caracter, no el chr
#if (line[0]!=62) && (line[0]!=48)
if (line[0]!='>'[0]) && (line[0]!='0'[0])
#puts line
- #puts line,line[0]
+ # puts line,line[0]
if line =~ />([^\.]+)\.\.\.\s/
#puts 'ok'
@clusters[$1]=1
end
end
@@ -154,9 +163,15 @@
# Return the linker of param
def get_linker(linker)
return @linkers[linker]
end
+
+ # Return the ab of param
+ def get_ab_adapter(adapter)
+ return @ab_adapters[adapter]
+ end
+
def get_plugin
plugin='General'
# puts caller(2)[1]
at = caller(2)[1]