[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "med.bio" under Ubuntu-MATE 18.04 LTS



On 27/05/18 23:13, Tony Travis wrote:
> [...]
>>   File "/usr/share/metaphlan2/_metaphlan2.py", line 22
>>     print("Command: {}".format(' '.join(cmd)), end='\n\n')
>>                                                   ^
>> SyntaxError: invalid syntax

Hi,

The problem is that "_metaphlan2.py" uses Python3 syntax but the Debian
"postinst" script runs "pycompile" on it, which defaults to Python2.

Here is a patch, with the print function included from the future and
function annotations removed.

HTH,

  Tony.

-- 
Minke Informatics Limited, Registered in Scotland - Company No. SC419028
Registered Office: 3 Donview, Bridge of Alford, AB33 8QJ, Scotland (UK)
tel. +44(0)19755 63548                    http://minke-informatics.co.uk
mob. +44(0)7985 078324        mailto:tony.travis@minke-informatics.co.uk
--- _metaphlan2.py.orig	2018-02-07 10:43:00.000000000 +0000
+++ _metaphlan2.py	2018-05-28 01:27:41.168280522 +0100
@@ -3,7 +3,7 @@
 # This module defines the functions which run MetaPhlAn2 on
 # single and paired fastq data.
 
-
+from __future__ import print_function
 import subprocess as sb
 from q2_types.per_sample_sequences import SingleLanePerSampleSingleEndFastqDirFmt
 from q2_types.per_sample_sequences import SingleLanePerSamplePairedEndFastqDirFmt
@@ -11,7 +11,6 @@
 import biom
 import os
 
-
 def metaphlan2_helper(raw_data, nproc, input_type, output_file, verbose=True):
     cmd = ['metaphlan2.py', str(raw_data), '--input_type', str(input_type),
            '--biom', str(output_file), '--nproc', str(nproc)]
@@ -24,8 +23,7 @@
     sb.run(cmd, check=True)
 
 
-def profile_single_fastq(raw_data: SingleLanePerSampleSingleEndFastqDirFmt,
-                         nproc: int=1) -> biom.Table:
+def profile_single_fastq(raw_data, nproc=1):
     output_biom = None
 
     with tempfile.TemporaryDirectory() as tmp_dir:
@@ -36,8 +34,7 @@
     return output_biom
 
 
-def profile_paired_fastq(raw_data: SingleLanePerSamplePairedEndFastqDirFmt,
-                         nproc: int=1) -> biom.Table:
+def profile_paired_fastq(raw_data, nproc=1):
     output_biom = None
 
     with tempfile.TemporaryDirectory() as tmp_dir:

Reply to: