biolab 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.py +11 -0
- package/100.py +18 -0
- package/2.py +11 -0
- package/3.py +31 -0
- package/4.py +33 -0
- package/5.py +23 -0
- package/6.py +11 -0
- package/7.py +9 -0
- package/81.py +28 -0
- package/91.py +14 -0
- package/aligned.fasta +6 -0
- package/aligned_sequences.aln +7 -0
- package/aligned_sequences.fasta +6 -0
- package/f8.fasta +6 -0
- package/fasta_1 (1).fasta +1196 -0
- package/genbank.gb +2302 -0
- package/input_sequences.fasta +6 -0
- package/muscle3.8.31_i86win32.exe +0 -0
- package/output.pdb +5834 -0
- package/package.json +11 -0
- package/pdb/pdb1tup.ent +6549 -0
- package/pdb1a3n.ent +5699 -0
package/1.py
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
from Bio.Seq import Seq
|
2
|
+
|
3
|
+
seq1=Seq("AGCTAGTAGCTGACGATCGATCGATCGCT")
|
4
|
+
seq2=Seq("AGTCGTCGTCAGGATCGATCGTCGA")
|
5
|
+
sliced=seq1[3:11]
|
6
|
+
concat=sliced+seq2
|
7
|
+
trans=sliced.transcribe()
|
8
|
+
translate=concat.translate()
|
9
|
+
print(sliced)
|
10
|
+
print(concat)
|
11
|
+
print(trans, translate)
|
package/100.py
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
from Bio.PDB import PDBParser,PDBList
|
2
|
+
import matplotlib.pyplot as plt
|
3
|
+
from mpl_toolkits.mplot3d import Axes3D
|
4
|
+
import numpy as np
|
5
|
+
|
6
|
+
pdb_id="1A3N"
|
7
|
+
pdb_list=PDBList()
|
8
|
+
filepath=pdb_list.retrieve_pdb_file(pdb_id,pdir=".",file_format="pdb")
|
9
|
+
pdpp=PDBParser(QUIET=True)
|
10
|
+
structure =pdpp.get_structure(pdb_id,filepath)
|
11
|
+
|
12
|
+
coords=[atom.coord for atom in structure.get_atoms()]
|
13
|
+
coords=np.array(coords)
|
14
|
+
|
15
|
+
fig=plt.figure()
|
16
|
+
ax=fig.add_subplot(111,projection="3d")
|
17
|
+
ax.scatter(coords[:,0],coords[:,1],coords[:,2],c="blue",s=10)
|
18
|
+
plt.show()
|
package/2.py
ADDED
package/3.py
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
from Bio.Seq import Seq
|
2
|
+
from Bio import SeqIO
|
3
|
+
from Bio.SeqRecord import SeqRecord
|
4
|
+
|
5
|
+
# Define the sequence
|
6
|
+
seq1 = Seq("AGTCTGACTAACGATGCGTACGT")
|
7
|
+
|
8
|
+
# Create the SeqRecord
|
9
|
+
record = SeqRecord(
|
10
|
+
seq1,
|
11
|
+
id="1",
|
12
|
+
name="svscv",
|
13
|
+
description="Example DNA sequence",
|
14
|
+
annotations={
|
15
|
+
"molecule_type": "DNA",
|
16
|
+
"organism": "Unknown organism"
|
17
|
+
}
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
# Write to GenBank file
|
23
|
+
file_path = "genbank.gb"
|
24
|
+
with open(file_path, "w") as f:
|
25
|
+
SeqIO.write(record, f, "genbank")
|
26
|
+
|
27
|
+
# Read back and print
|
28
|
+
with open(file_path, "r") as f:
|
29
|
+
read_record = SeqIO.read(f, "genbank")
|
30
|
+
|
31
|
+
print(read_record)
|
package/4.py
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
from Bio import Seq
|
2
|
+
from Bio.Seq import Seq
|
3
|
+
from Bio import SeqIO
|
4
|
+
from Bio.SeqRecord import SeqRecord
|
5
|
+
|
6
|
+
fasta="fasta_1 (1).fasta"
|
7
|
+
with open(fasta,"r") as f:
|
8
|
+
records=[]
|
9
|
+
for record in SeqIO.parse(f,"fasta"):
|
10
|
+
seq=record.seq
|
11
|
+
des=record.description
|
12
|
+
|
13
|
+
re=SeqRecord(
|
14
|
+
seq,
|
15
|
+
id="1",
|
16
|
+
name="wfew",
|
17
|
+
description=des,
|
18
|
+
annotations={
|
19
|
+
"gene": "DNA",
|
20
|
+
"molecule_type":"DNA",
|
21
|
+
"function":"dssadc",
|
22
|
+
"organism":"unknown organism"
|
23
|
+
}
|
24
|
+
)
|
25
|
+
records.append(re)
|
26
|
+
|
27
|
+
|
28
|
+
with open("genbank.gb","w") as ge:
|
29
|
+
SeqIO.write(records,ge,"genbank")
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
package/5.py
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
from Bio.SeqRecord import SeqRecord
|
2
|
+
from Bio.SeqFeature import SeqFeature,FeatureLocation
|
3
|
+
from Bio.Seq import Seq
|
4
|
+
|
5
|
+
seq1=Seq("ATCGATGTGCATCGTACCGATCGCAGT")
|
6
|
+
|
7
|
+
record=SeqRecord(
|
8
|
+
seq1,
|
9
|
+
id="1",
|
10
|
+
name="unk",
|
11
|
+
description="fsefsd"
|
12
|
+
|
13
|
+
)
|
14
|
+
|
15
|
+
|
16
|
+
record.annotations["gene"]="gene"
|
17
|
+
record.annotations["molecule_type"]="DNA"
|
18
|
+
|
19
|
+
seqf=SeqFeature(FeatureLocation(0,21),type="gene",qualifiers={"gene":"exmaple gene"})
|
20
|
+
|
21
|
+
record.annotations["function"]="Simple"
|
22
|
+
print({record.id})
|
23
|
+
print(record)
|
package/6.py
ADDED
package/7.py
ADDED
package/81.py
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
from Bio.Align.Applications import MuscleCommandline
|
2
|
+
from Bio import AlignIO
|
3
|
+
seq1 = """>seq1
|
4
|
+
AGTCATGCAT
|
5
|
+
"""
|
6
|
+
seq2 = """>seq2
|
7
|
+
ATGCATGCAT
|
8
|
+
"""
|
9
|
+
seq3=""">seq3
|
10
|
+
ACGTCGATCG
|
11
|
+
"""
|
12
|
+
with open("f8.fasta","w") as f:
|
13
|
+
f.write(seq1)
|
14
|
+
f.write(seq2)
|
15
|
+
f.write(seq3)
|
16
|
+
|
17
|
+
muscle="muscle3.8.31_i86win32.exe"
|
18
|
+
|
19
|
+
m_cline=MuscleCommandline(cmd=muscle,input="f8.fasta",out="aligned.fasta")
|
20
|
+
|
21
|
+
stdout,stderr=m_cline()
|
22
|
+
|
23
|
+
if(stderr):
|
24
|
+
print(stderr)
|
25
|
+
|
26
|
+
|
27
|
+
align=AlignIO.read("aligned.fasta","fasta")
|
28
|
+
print(align)
|
package/91.py
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
from Bio.Phylo.TreeConstruction import DistanceTreeConstructor ,DistanceCalculator
|
2
|
+
|
3
|
+
from Bio import Phylo ,AlignIO
|
4
|
+
alignment=AlignIO.read("aligned_sequences.aln","clustal")
|
5
|
+
|
6
|
+
cal=DistanceCalculator('identity')
|
7
|
+
|
8
|
+
matrix=cal.get_distance(alignment)
|
9
|
+
|
10
|
+
trees=DistanceTreeConstructor()
|
11
|
+
tree=trees.upgma(matrix)
|
12
|
+
|
13
|
+
Phylo.draw(tree)
|
14
|
+
|
package/aligned.fasta
ADDED