gfa 0.6.3 → 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: 6e858670d104b7602c27ef71b2942f355027eb3e34dfc9c9aa5d9aa6a3a8ebbc
4
- data.tar.gz: 4a905a283972c8d0704c90feb81a90becc73af7dffb328cf108145c0e0103023
3
+ metadata.gz: a7a646a57c98f25bda2120b3e04783099433d7aa7c8f0658a1bfdcd07e0dea35
4
+ data.tar.gz: c8aec87b21fd9b1d7972228fa7118cf71b40f58a5dd20e385e6e80ef86b2ef92
5
5
  SHA512:
6
- metadata.gz: cda7d12b5f2c6bd18e991d8591a2788d85a2dd29c99bfcc0e0d20c40978199e81099875453d9f34a188e4f723177acc09c2990d25062ef7082556a96f97b56ac
7
- data.tar.gz: 18e5ff044ffd143e95fbc8525756215437528468b094136f622a30cfde7a51b8d25ca4c1e8a26300a3027ec79fafdbdda343af3cebf9e1c2813467c983b67873
6
+ metadata.gz: 3f4c54a483e4cd6baaf66fbddda2e7eb41a13cd14bd492c5132a2d2610bdd2f283d7a92c261dca10f54fb9e03611ca7f7c05036fa783c361d4b8e752e9fd6b53
7
+ data.tar.gz: 2b17c35013f3c9dbdb99a20e060c2dde13732c139f0551f3ce5b65e317ad5d1918b84447570542b11b67f5d65387729606de914b18994c420e5fe8b41b9bf5af
@@ -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.3'
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.3
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