2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/mutations_caller_pipeline_aws/location_file.rb', line 2
def self.create(vcf_file, loction_file_output)
locations = File.open(vcf_file)
line = locations.readline()
locus = []
while line.include?('#')
location = line.scan(/##contig=<ID=+\w+/)
if !location.empty?()
location = location[0].split('=')
locus << location[-1]
end
line = locations.readline()
end
locations.close()
locus_file = File.new(location_file_output,'w')
locus_file.write(locus.join("\n"))
locus_file.close()
end
|