Top Level Namespace

Defined Under Namespace

Modules: BioPangenome Classes: GFF3, MrnaStats, MultipleGFFs, String

Constant Summary collapse

USAGE =

BioRuby bio-pangenome Plugin BioPangenome

Author

homonecloco

Copyright

2019

"pangenome_gene_bed_files.rb [options]"
VERSION_FILENAME =
File.join(gempath,'VERSION')

Instance Method Summary collapse

Instance Method Details

#bedAroundToRegions(lines: [], distance: 1000, prefix: "../flanking/filtered/", suffix: ".RefSeqv1.1.reg", suffix_in: ".RefSeqv1.1.bed") ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'bin/pangenome_gene_bed_files.rb', line 80

def bedAroundToRegions(lines:[], distance: 1000, prefix: "../flanking/filtered/", suffix: ".RefSeqv1.1.reg" , suffix_in: ".RefSeqv1.1.bed" )
    lines.each do |k|
        path="#{prefix}#{k}_#{distance}bp_#{suffix_in}"
        path2="#{prefix}#{k}_#{distance}bp_#{suffix}"
        path3="#{prefix}#{k}_#{distance}bp_#{suffix}.map"
        puts path
        out=File.open(path2, "w")
        out2=File.open(path3, "w")
        File.foreach(path) do |line|
           # puts line
            arr = line.chomp!.split "\t"
            first=arr[1]
            last=arr[2]
            name=arr[0]
            #if(arr[5] == "-")
            #    first=arr[2]
            #    last=arr[1]
            #end
          
            reg =  "#{name}:#{first}-#{last}"
            out.puts reg
            out2.puts [reg,arr[3]].join "\t"
            #puts reg
            #v.bedAroundGene(distance:distance, out:out)
            #break
        end
        out.close
        out2.close
    end
end