gfa 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8069525ab289a4299c4d51df9a58a083df95292cd7bc59b83516ac4c5e7508f2
4
- data.tar.gz: c1398a889d1f49431bfa01b196084ee9c448c60426fb179801151e7731538c03
3
+ metadata.gz: a7a646a57c98f25bda2120b3e04783099433d7aa7c8f0658a1bfdcd07e0dea35
4
+ data.tar.gz: c8aec87b21fd9b1d7972228fa7118cf71b40f58a5dd20e385e6e80ef86b2ef92
5
5
  SHA512:
6
- metadata.gz: d97f574a6081727f5687e259a954881351bf7767ec36d1f5ac8b2e6eef939a59a9406077619b306d9782e99357ec2cb98536b4e73474a9aad75c61614c7f7d13
7
- data.tar.gz: 385a463ad705401ec083375b917d3654633f44e3828fcc93546422fb80712fc4bc22dbc2dd128dbdf1db44a8c60ed4d7a31df558db8786eb1fca12225a29b2ab
6
+ metadata.gz: 3f4c54a483e4cd6baaf66fbddda2e7eb41a13cd14bd492c5132a2d2610bdd2f283d7a92c261dca10f54fb9e03611ca7f7c05036fa783c361d4b8e752e9fd6b53
7
+ data.tar.gz: 2b17c35013f3c9dbdb99a20e060c2dde13732c139f0551f3ce5b65e317ad5d1918b84447570542b11b67f5d65387729606de914b18994c420e5fe8b41b9bf5af
data/bin/gfa-add-gaf CHANGED
@@ -8,7 +8,7 @@ $LOAD_PATH.push File.expand_path('../../lib', File.realpath(__FILE__))
8
8
 
9
9
  require 'gfa'
10
10
 
11
- input_gfa, input_gaf, output, degree, threads = ARGV
11
+ input_gfa, input_gaf, output, degree, pref, threads = ARGV
12
12
 
13
13
  unless degree
14
14
  $stderr.puts <<~HELP
@@ -8,29 +8,42 @@ $LOAD_PATH.push File.expand_path('../../lib', File.realpath(__FILE__))
8
8
 
9
9
  require 'gfa'
10
10
 
11
- input, output, threads = ARGV
11
+ input, output, threads, orphan = ARGV
12
12
 
13
13
  unless output
14
14
  $stderr.puts <<~HELP
15
15
  Extract the sequences of the paths from a GFA to FastA file
16
16
 
17
- gfa-merge <input> <output> [<threads>]
17
+ gfa-merge <input> <output> [<threads> [<orphan>]]
18
18
 
19
19
  <input> Input GFA file to read
20
20
  <output> Output FastA file to be created
21
21
  <threads> If passed, parallelize process with these many threads
22
+ <orphan> If set to 'yes', it also outputs the sequences of all
23
+ segments that are not included in any path
22
24
  HELP
23
25
  exit(1)
24
26
  end
25
27
 
26
28
  $stderr.puts "Loading GFA: #{input}"
29
+ orphan ||= 'no'
27
30
  gfa = GFA.load_parallel(input, (threads || 1).to_i)
28
31
 
29
32
  $stderr.puts "Saving path sequences: #{output}"
30
33
  File.open(output, 'w') do |fasta|
34
+ in_path = {}
31
35
  gfa.paths.set.each do |path|
32
36
  fasta.puts '>%s' % path.path_name.value
33
37
  fasta.puts path.sequence(gfa)
38
+ path.segment_names_a.each { |i| in_path[i] = true }
39
+ end
40
+
41
+ if orphan == 'yes'
42
+ gfa.segments.set.each do |segment|
43
+ next if in_path[segment.name.value]
44
+ fasta.puts '>S:%s' % segment.name.value
45
+ fasta.puts segment.sequence.value
46
+ end
34
47
  end
35
48
  end
36
49
 
data/lib/gfa/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class GFA
2
- VERSION = '0.6.2'
2
+ VERSION = '0.7.0'
3
3
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
4
4
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
5
5
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rgl