Question: how can i use python to align dna sequences with t-coffee algorithm??
0
gravatar for sallyzaki70
8 weeks ago by
sallyzaki7010
sallyzaki7010 wrote:

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

ADD COMMENTlink modified 8 weeks ago by vijinim50 • written 8 weeks ago by sallyzaki7010

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 REPLYlink written 8 weeks ago by Bastien Hervé2.8k

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 REPLYlink written 6 weeks ago by sallyzaki7010

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

ADD REPLYlink written 6 weeks ago by Bastien Hervé2.8k
1
gravatar for vijinim
8 weeks ago by
vijinim50
vijinim50 wrote:

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 COMMENTlink modified 8 weeks ago • written 8 weeks ago by vijinim50
1

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 REPLYlink written 6 weeks ago by sallyzaki7010

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

ADD REPLYlink written 5 weeks ago by vijinim50
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1093 users visited in the last hour