I am using the call()
function from a Python script to preform a command from an external software. I want to store the output of the function into a variable and work with the variable. But, the output value is not getting stored into the variable at all.
When I give the command to print variable, it prints 0 which is the default value. The code is:
from subprocess inport call
print "\n Summarizing mutations"
summary_mutation = call(["halSummarizeMutations", hal_output])
print summary_mutation
The hal_output is the input file given to command halSummarizeMutations. The output I am getting is:
GenomeName, ParentName, BranchLength, GenomeLength, ParentLength, Subtitutions, Transitions, Transversions, Matches, GapInsertions, GapInsertedBases, GapDeletions, GapDeletedBases, Insertions, InsertionBases, Deletions, DeletionBases, Inversions, InvertedBases, Duplications, DuplicatedBases, Transpositions, TranspositionBases, Other
ancestral_sequences, homo_sapiens, 1, 225206, 248956422, 149218, 49494, 99724, 49433, 10, 698, 0, 0, 17, 20539, 10, 4345, 1343, 134907, 672, 57699, 0, 0, 0
gorilla_gorilla, homo_sapiens, 1, 229507203, 248956422, 44226, 13434, 26644, 15224, 68, 593, 120, 6319, 15, 229443572, 6, 857, 0, 0, 0, 0, 0, 0, 10
papio_anubis, homo_sapiens, 1, 220367699, 248956422, 98187, 32113, 64759, 32284, 6, 1418, 11, 245, 36, 220231921, 30, 7448, 791, 109496, 0, 0, 0, 0, 0
Total, ,3, 450100108, 746869266, 291631, 95041, 191127, 96941, 84, 2709, 131, 6564, 68, 449696032, 46, 12650, 2134, 244403, 672, 57699, 0, 0, 0
Average, ,1, 150033369, 248956422, 97210, 31680, 63709, 32313, 28, 903, 43, 2188, 22, 149898677, 15, 4216, 711, 81467, 224, 19233, 0, 0, 0
0
where 0 is the value of summary_mutation variable. Please help me out. Thanks in advance.