Skip to content

Commit 57f815a

Browse files
authored
Add pdb2fasta (#52973)
1 parent 2eaddb7 commit 57f815a

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

recipes/pdb2fasta/build.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -euo
2+
3+
mkdir -p ${PREFIX}/bin
4+
${CC} -O2 pdb2fasta.c -o pdb2fasta
5+
mv pdb2fasta ${PREFIX}/bin

recipes/pdb2fasta/meta.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% set name = "pdb2fasta" %}
2+
{% set version = "1.0" %}
3+
4+
package:
5+
name: {{ name }}
6+
version: {{ version }}
7+
8+
source:
9+
url: https://github.com/kad-ecoli/{{ name }}/archive/refs/tags/{{ version }}.tar.gz
10+
sha256: 63c22998df75c0a1ee9c00051d4d401e45b13651a09b98bb2885a86bc342b7bf
11+
patches:
12+
- pdb2fasta.patch
13+
14+
build:
15+
number: 0
16+
run_exports:
17+
- {{ pin_subpackage('pdb2fasta', max_pin="x.x") }}
18+
19+
requirements:
20+
build:
21+
- {{ compiler('c') }}
22+
23+
test:
24+
commands:
25+
- pdb2fasta --help
26+
27+
about:
28+
home: "https://github.com/kad-ecoli/pdb2fasta"
29+
license: "GPL-2-only"
30+
license_family: GPL2
31+
license_file: License.txt
32+
summary: "Convert PDB structures to FASTA sequences."
33+
dev_url: "https://github.com/kad-ecoli/pdb2fasta"
34+
35+
extra:
36+
additional-platforms:
37+
- linux-aarch64
38+
- osx-arm64

recipes/pdb2fasta/pdb2fasta.patch

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/pdb2fasta.c b/pdb2fasta.c
2+
index 9642d03..9e8eef1 100644
3+
--- a/pdb2fasta.c
4+
+++ b/pdb2fasta.c
5+
@@ -1,3 +1,4 @@
6+
+#include<stdlib.h>
7+
#include<stdio.h>
8+
#include<string.h>
9+
10+
@@ -99,14 +100,24 @@ char *pdb2fasta(char *pdb_file){
11+
}
12+
13+
int main(int argc, char** argv){
14+
- if (argc<2){
15+
- printf("pdb2fasta pdb.pdb > seq.fasta\n");
16+
- printf(" convert PDB file pdb.pdb to FASTA sequence file seq.fasta\n");
17+
+ if (argc < 2){
18+
+ printf("Usage: pdb2fasta pdb.pdb > seq.fasta\n");
19+
+ printf(" Convert PDB file pdb.pdb to FASTA sequence file seq.fasta\n");
20+
return argc;
21+
}
22+
-
23+
- int i;
24+
- for (i=1;i<argc;i++){
25+
+
26+
+ if (argc == 2 && strcmp(argv[1], "--help") == 0) {
27+
+ printf("Usage: pdb2fasta [options] pdb.pdb\n");
28+
+ printf("Options:\n");
29+
+ printf(" --help Display this help dialogue and exit\n");
30+
+ printf("\nDescription:\n");
31+
+ printf(" Convert a PDB file to a FASTA sequence format. Output is printed to stdout.\n");
32+
+ printf(" Example:\n");
33+
+ printf(" pdb2fasta pdb.pdb > seq.fasta\n");
34+
+ return 0;
35+
+ }
36+
+
37+
+ for (int i=1; i<argc; i++){
38+
char *pdb_file=argv[i];
39+
printf("%s",pdb2fasta(pdb_file));
40+
}

0 commit comments

Comments
 (0)