Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,28 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Simple_FASTA is
|
||||
|
||||
Current: Character;
|
||||
|
||||
begin
|
||||
Get(Current);
|
||||
if Current /= '>' then
|
||||
raise Constraint_Error with "'>' expected";
|
||||
end if;
|
||||
while not End_Of_File loop -- read name and string
|
||||
Put(Get_Line & ": "); -- read name and write directly to output
|
||||
Read_String:
|
||||
loop
|
||||
exit Read_String when End_Of_File; -- end of input
|
||||
Get(Current);
|
||||
if Current = '>' then -- next name
|
||||
New_Line;
|
||||
exit Read_String;
|
||||
else
|
||||
Put(Current & Get_Line);
|
||||
-- read part of string and write directly to output
|
||||
end if;
|
||||
end loop Read_String;
|
||||
end loop;
|
||||
|
||||
end Simple_FASTA;
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
with Ada.Text_IO, Ada.Containers.Indefinite_Ordered_Maps; use Ada.Text_IO;
|
||||
|
||||
procedure FASTA is
|
||||
package Maps is new Ada.Containers.Indefinite_Ordered_Maps
|
||||
(Element_Type => String, Key_Type => String);
|
||||
Map: Maps.Map; -- Map holds the full file (as pairs of name and value)
|
||||
|
||||
function Get_Value(Previous: String := "") return String is
|
||||
Current: Character;
|
||||
begin
|
||||
if End_Of_File then
|
||||
return Previous; -- file ends
|
||||
else
|
||||
Get(Current); -- read first character
|
||||
if Current = '>' then -- ah, a new name begins
|
||||
return Previous; -- the string read so far is the value
|
||||
else -- the entire line is part of the value
|
||||
return Get_Value(Previous & Current & Get_Line);
|
||||
end if;
|
||||
end if;
|
||||
end Get_Value;
|
||||
|
||||
procedure Print_Pair(Position: Maps.Cursor) is
|
||||
begin
|
||||
Put_Line(Maps.Key(Position) & ": " & Maps.Element(Position));
|
||||
-- Maps.Key(X) is the name and Maps.Element(X) is the value at X
|
||||
end Print_Pair;
|
||||
|
||||
Skip_This: String := Get_Value;
|
||||
-- consumes the entire file, until the first line starting with '>'.
|
||||
-- the string Skip_This should be empty, but we don't verify this
|
||||
|
||||
begin
|
||||
while not End_Of_File loop -- read the file into Map
|
||||
declare
|
||||
Name: String := Get_Line;
|
||||
-- reads all characters in the line, except for the first ">"
|
||||
Value: String := Get_Value;
|
||||
begin
|
||||
Map.Insert(Key => Name, New_Item => Value);
|
||||
-- adds the pair (Name, Value) to Map
|
||||
end;
|
||||
end loop;
|
||||
|
||||
Map.Iterate(Process => Print_Pair'Access); -- print Map
|
||||
end FASTA;
|
||||
|
|
@ -2,11 +2,11 @@ parseFasta: function [data][
|
|||
result: #[]
|
||||
current: ø
|
||||
loop split.lines data 'line [
|
||||
if? `>` = first line [
|
||||
switch '>' = first line [
|
||||
current: slice line 1 (size line)-1
|
||||
set result current ""
|
||||
]
|
||||
else ->
|
||||
->
|
||||
set result current (get result current)++line
|
||||
]
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -2,15 +2,14 @@ repeat
|
|||
s$ = input
|
||||
until s$ = ""
|
||||
if substr s$ 1 1 = ">"
|
||||
if stat = 1
|
||||
print ""
|
||||
.
|
||||
if stat = 1 : print ""
|
||||
stat = 1
|
||||
print s$
|
||||
else
|
||||
write s$
|
||||
.
|
||||
.
|
||||
print ""
|
||||
input_data
|
||||
>Rosetta_Example_1
|
||||
THERECANBENOSPACE
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
my $fasta_example = <<'END_FASTA_EXAMPLE';
|
||||
>Rosetta_Example_1
|
||||
THERECANBENOSPACE
|
||||
>Rosetta_Example_2
|
||||
THERECANBESEVERAL
|
||||
LINESBUTTHEYALLMUST
|
||||
BECONCATENATED
|
||||
END_FASTA_EXAMPLE
|
||||
|
||||
my $num_newlines = 0;
|
||||
while ( < $fasta_example > ) {
|
||||
if (/\A\>(.*)/) {
|
||||
print "\n" x $num_newlines, $1, ': ';
|
||||
}
|
||||
else {
|
||||
$num_newlines = 1;
|
||||
print;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
$file = @'
|
||||
>Rosetta_Example_1
|
||||
THERECANBENOSPACE
|
||||
>Rosetta_Example_2
|
||||
THERECANBESEVERAL
|
||||
LINESBUTTHEYALLMUST
|
||||
BECONCATENATED
|
||||
'@
|
||||
|
||||
$lines = $file.Replace("`n","~").Split(">").ForEach({$_.TrimEnd("~").Split("`n",2,[StringSplitOptions]::RemoveEmptyEntries)})
|
||||
|
||||
$output = New-Object -TypeName PSObject
|
||||
|
||||
foreach ($line in $lines)
|
||||
{
|
||||
$name, $value = $line.Split("~",2).ForEach({$_.Replace("~","")})
|
||||
|
||||
$output | Add-Member -MemberType NoteProperty -Name $name -Value $value
|
||||
}
|
||||
|
||||
$output | Format-List
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
$file = @'
|
||||
>Rosetta_Example_1
|
||||
THERECANBENOSPACE
|
||||
>Rosetta_Example_2
|
||||
THERECANBESEVERAL
|
||||
LINESBUTTHEYALLMUST
|
||||
BECONCATENATED
|
||||
'@
|
||||
|
||||
$lines = $file.Replace("`n","~").Split(">") | ForEach-Object {$_.TrimEnd("~").Split("`n",2,[StringSplitOptions]::RemoveEmptyEntries)}
|
||||
|
||||
$output = New-Object -TypeName PSObject
|
||||
|
||||
foreach ($line in $lines)
|
||||
{
|
||||
$name, $value = $line.Split("~",2) | ForEach-Object {$_.Replace("~","")}
|
||||
|
||||
$output | Add-Member -MemberType NoteProperty -Name $name -Value $value
|
||||
}
|
||||
|
||||
$output | Format-List
|
||||
Loading…
Add table
Add a link
Reference in a new issue