how can i use python to align dna sequences with t-coffee algorithm??
1
0
Entering edit mode
6.0 years ago
sallyzaki70 ▴ 10

Hi i am a python beginner

i want to use python to align alot of sequences with t-coffee algorithm

what environment should i have?i mean i should install python and what else?

sample dataset

>X05053.1-3_118
CCTGGCGGCCATGGCGAACCGGAACCACCCGATCCCATCTCGAACTCGGAAGTGAAACGG
TTCAGCGCCGATGA-TAGTGTG--GGGCCTCCCCATGTGAAAGTAGGTCACTGCCAGGC
>M36159.1-2_116
-CAGGTGGTGATGGCGGAAAGGTCACACCCGAACACATCCCGAACTCGGAAGTTAAGCTT
TCCAGCGCCGATG-GTAGTTGG--GGGTTTCCCCCTGCGAGAGTAGGACGTTGCCGGGC
>Z50737.1-3_119
AACGGCGGTCATAGCGGTGGGGAAACGCCCGGTCCCATCCCGAACCCGGAAGCTAAGCCC
ACCAGCGCCGATG-GTACTGCACTC-GTGAGGGTGTGGGAGAGTAGGACGCCGCCGGAC
>X02631.1-2_115
GCTGGCGACCATAGCAAGAGTGAACCACCTGATCCCTTCCCGAACTCAGAAGTGAAACCT
CTTCGCGCTGATG-GTAGTGNGG-GT--TA-CCCATGTGAGAGTAAGTCATCGCCAGCT
>Z50057.1-2_118
GTCGGTGGTCATTGCGGAGGGGGAACGCCCGGTCCCATCCCGAACCCGGAAGCTAAGCCC
TCCAGCGCCGATG-GTACTGCACTC-GCCAGGGTGTGGGAGAGTAGGTCGCCGCCGACA

thanks in advance

sequencing alignment t-coffee python • 2.5k views
ADD COMMENT
0
Entering edit mode

You will have to install the T-Coffee project

But you don't need python to run this program. Eventualy you can use python to create the T-Coffee command line

ADD REPLY
0
Entering edit mode

I specially want to make a comparison between 3 algorithms (t-coffee , muscle , clustal) so I want to make apython code for every algorithm in this code I should call a lot of alignment

ADD REPLY
0
Entering edit mode

You can subprocess using python, see the answer of biopanda below

ADD REPLY
1
Entering edit mode
6.0 years ago
vijinim ▴ 100

Biopython provides a command line wrapper for T-Coffee. However it has a limited number of options.

You can install T-Coffee from the T-Coffee Project homepage as Bastien mentioned and run it directly. However if you wish to run T-Coffee commands within a python program you have developed, you can use the subprocess module of python to run the T-Coffee commands. After installing T-Coffee as per the installation guidelines, you can run your command as given below using Python 3.5 or higher.

import subprocess
subprocess.run(['t_coffee', 'sample.fasta'])

Note that sample.fasta contains your sample sequences.

The run() function will not capture the output of T-Coffee. If you want to capture the output of T-Coffee you can pass the subprocess.PIPE flag to the stdout argument of the run() function and then access the stdout attribute of the returned object.

output = subprocess.run(['t_coffee', 'sample.fasta'], stdout=subprocess.PIPE)
print(output.stdout)

Hope this helps. :)

ADD COMMENT
1
Entering edit mode

thanks alot I specially want to make a comparison between 3 algorithms (t-coffee , muscle , clustal) so I want to make apython code for every algorithm.in this code I should call a lot of alignment

I hope you help me

ADD REPLY
0
Entering edit mode

You will have to write python scripts and call the subprocess module to run each .

ADD REPLY

Login before adding your answer.

Traffic: 1536 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6