Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
2
Task/FASTA-format/J/fasta-format-1.j
Normal file
2
Task/FASTA-format/J/fasta-format-1.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require 'strings' NB. not needed for J versions greater than 6.
|
||||
parseFasta=: ((': ' ,~ LF&taketo) , (LF -.~ LF&takeafter));._1
|
||||
11
Task/FASTA-format/J/fasta-format-2.j
Normal file
11
Task/FASTA-format/J/fasta-format-2.j
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Fafile=: noun define
|
||||
>Rosetta_Example_1
|
||||
THERECANBENOSPACE
|
||||
>Rosetta_Example_2
|
||||
THERECANBESEVERAL
|
||||
LINESBUTTHEYALLMUST
|
||||
BECONCATENATED
|
||||
)
|
||||
parseFasta Fafile
|
||||
Rosetta_Example_1: THERECANBENOSPACE
|
||||
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
|
||||
28
Task/FASTA-format/J/fasta-format-3.j
Normal file
28
Task/FASTA-format/J/fasta-format-3.j
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
bs=: 2
|
||||
chunkFasta=: {{
|
||||
r=. EMPTY
|
||||
bad=. a.-.a.{~;48 65 97(+i.)each 10 26 26
|
||||
dir=. x,'/'
|
||||
off=. 0
|
||||
siz=. fsize y
|
||||
block=. dest=. ''
|
||||
while. off < siz do.
|
||||
block=. block,fread y;off([, [ -~ siz<.+)bs
|
||||
off=. off+bs
|
||||
while. LF e. block do.
|
||||
line=. LF taketo block
|
||||
select. {.line
|
||||
case. ';' do.
|
||||
case. '>' do.
|
||||
start=. }.line-.CR
|
||||
r=.r,(head=. name,'.head');<name=. dir,start -. bad
|
||||
start fwrite head
|
||||
'' fwrite name
|
||||
case. do.
|
||||
(line-.bad) fappend name
|
||||
end.
|
||||
block=. LF takeafter block
|
||||
end.
|
||||
end.
|
||||
r
|
||||
}}
|
||||
1
Task/FASTA-format/J/fasta-format-4.j
Normal file
1
Task/FASTA-format/J/fasta-format-4.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
fasta=: '~temp' chunkFasta '~/fasta.txt'
|
||||
3
Task/FASTA-format/J/fasta-format-5.j
Normal file
3
Task/FASTA-format/J/fasta-format-5.j
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
;(,': ',,&LF)each/"1 fread each fasta
|
||||
Rosetta_Example_1: THERECANBENOSPACE
|
||||
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED
|
||||
Loading…
Add table
Add a link
Reference in a new issue