-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3c75a4
commit 5d20e0a
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# julia | ||
using ArgParse | ||
using BioStructures | ||
# input parameters function | ||
function parse_commandline() | ||
|
||
s = ArgParseSettings(description = "read a pdb file from PDB and convert it to fasta without the need to download it choosing the model and chain") | ||
@add_arg_table s begin | ||
"--pdb" | ||
help = "input pdb ids" | ||
"--model" | ||
help = "model to make the fasta file for" | ||
"--chain" | ||
help = "chain in model to make the fasta file for" | ||
"--out" | ||
help = "output fasta file" | ||
end | ||
return parse_args(s) | ||
end | ||
|
||
function main() | ||
parsed_args = parse_commandline() | ||
println(parsed_args) | ||
# main | ||
downloadpdb(parsed_args["pdb"]) do fp | ||
s = read(fp, PDB) | ||
open(parsed_args["out"],"a") do io | ||
println(io,">",parsed_args["pdb"],"_",parsed_args["chain"],"\n",LongAminoAcidSeq(s[parse(Int, parsed_args["model"])][parsed_args["chain"]], standardselector, gaps=false)) | ||
end | ||
end | ||
end | ||
|
||
main() |