-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_pfam_alignment.py
More file actions
38 lines (23 loc) · 890 Bytes
/
get_pfam_alignment.py
File metadata and controls
38 lines (23 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import mysql.connector
##### User data #####
# MySQL Connection Information
Database = 'PFAMphylostratigraphy'
User = 'anhnguyenphung'
Host = '127.0.0.1'
Password = '9400_changethis'
# table to get sequences from
AlignmentTable = 'PfamAlignments'
PfamColumn = "PfamUID"
UIDColumn = "UID" ### pfams can be present multiple times in a genome
Seq = 'AlignedPeptide'
# The script then establishes a connection with the SQL database
cnx = mysql.connector.connect(user = User,
password = Password,
host = Host,
database = Database)
mycursor = cnx.cursor(buffered = True)
pfam = 'PF00450'
PullProteinsStatement = "SELECT * FROM %s WHERE %s='%s'" %(AlignmentTable, PfamColumn, pfam)
mycursor.execute(PullProteinsStatement)
ProteinSequences = mycursor.fetchall()
print(ProteinSequences)