parse_fasta 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/parse_fasta.rb +27 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c69c371d4a1517a6ef08c148ed9d04467486158b
|
4
|
+
data.tar.gz: 4001240274043ea9ec5532687e0d8abd84f3714b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2b2674b002f0e4920ea2142df9096103d3c7a9af6f3b15dc041d290d2e8f881bd236cb8823d4d8593fd8514571c075626678422ee6880559ccd71ef90a058fd0
|
7
|
+
data.tar.gz: 746b0171d3694052eea90fd989f99cc45514caccfe1265d18c434547202407c8d799b7dd8b785aea07e3a1c208da105c3818b529f4632c62b8f9f5142d308cf7
|
data/lib/parse_fasta.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright 2014 Ryan Moore
|
2
|
+
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
def parse_line(line)
|
17
|
+
line.chomp.split("\n", 2).map { |s| s.gsub(/\n|>/, '') }
|
18
|
+
end
|
19
|
+
|
20
|
+
class File
|
21
|
+
def each_record
|
22
|
+
self.each("\n>") do |line|
|
23
|
+
header, sequence = parse_line(line)
|
24
|
+
yield header.strip, sequence
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: parse_fasta
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Moore
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple monkey patch of the File class to easily parse fasta files.
|
14
|
+
email: moorer@udel.edu
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/parse_fasta.rb
|
20
|
+
homepage: https://github.com/mooreryan/parse_fasta
|
21
|
+
licenses:
|
22
|
+
- http://www.gnu.org/licenses/gpl.txt
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.2.2
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Simple API for parsing fasta files
|
44
|
+
test_files: []
|