dariober / SICERpy

Python wrapper around the popular ChIP-Seq peak caller SICER
15 stars 3 forks source link

SyntaxError: Missing parentheses in call to 'print' #5

Closed gongyixiao closed 7 years ago

gongyixiao commented 7 years ago

Hi, there,

I'm trying to install SICER and make it work on our cluster. I have downloaded the package from here, installed scipy and pysam and changed the path in the SICER.sh script. But when I trying to run a simple example command, I'm not able to make this example work. Here is the command I use and the error I got:

[xx@host ex]$ pwd /ifs/home/xx/utilities/SICER/ex [xx@host ex]$ module load python/3.5.3 [xx@host ex]$ ~/utilities/SICER/SICER.sh ./ test.bed control.bed . hg18 1 200 150 0.74 600 .01 #############################################

SICER v1.1

############################################# Input library directory: ./ ChIP library: test.bed Control library: control.bed Output directory: . Species: hg18 Threshold for redundancy allowed for chip reads: 1 Threshold for redundancy allowed for control reads: 1 Window size: 200 bps Fragment size: 150 bps. The shift for reads is half of 150 Effective genome size as a fraction of the reference genome of hg18: 0.74 Gap size: 600 bps Evalue for identification of candidate islands that exhibit clustering: 1000 False discovery rate controlling significance: .01

Preprocess the raw test file to remove redundancy with threshold 1... python /ifs/home/xx/utilities/SICER/src/remove_redundant_reads.py -s hg18 -b .//test.bed -t 1 -o ./test-1-removed.bed File "/ifs/home/xx/utilities/SICER/src/remove_redundant_reads.py", line 84 print chrom, "\tPlus reads:",p_total, "\tRetained plus reads:", p_retained, ";\tMinus reads:", m_total, "\tRetained minus reads:", m_retained; ^ SyntaxError: Missing parentheses in call to 'print'

Preprocess the raw control file to remove redundancy with threshold 1... python /ifs/home/xx/utilities/SICER/src/remove_redundant_reads.py -s hg18 -b .//control.bed -t 1 -o ./control-1-removed.bed File "/ifs/home/xx/utilities/SICER/src/remove_redundant_reads.py", line 84 print chrom, "\tPlus reads:",p_total, "\tRetained plus reads:", p_retained, ";\tMinus reads:", m_total, "\tRetained minus reads:", m_retained; ^ SyntaxError: Missing parentheses in call to 'print'

Partion the genome in windows ... Generate summary files ... python /ifs/home/xx/utilities/SICER/src/run-make-graph-file-by-chrom.py -s hg18 -b ./test-1-removed.bed -w 200 -i 150 -o ./test-W200.graph File "/ifs/home/xx/utilities/SICER/src/run-make-graph-file-by-chrom.py", line 27 print "Can not find the length of ", chrom; ^ SyntaxError: Missing parentheses in call to 'print'

Normalize summary graph by total island filtered reads per million for test ... python /ifs/home/xx/utilities/SICER/src/normalize.py -i ./test-W200.graph -a 3 -t 1000000 -o ./test-W200-normalized.graph Traceback (most recent call last): File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 60, in main(sys.argv) File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 55, in main total = total_counts(opt.input_file, opt.colum) / opt.ScalingFactor File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 32, in total_counts infile = open(file,'r') FileNotFoundError: [Errno 2] No such file or directory: './test-W200.graph'

Convert the normalized summary graph into wig vstep format... sh /ifs/home/xx/utilities/SICER/src/variableStep.sh ./test-W200-normalized.graph ./test-W200-normalized.wig test 200 head: cannot open ./test-W200-normalized.graph' for reading: No such file or directory grep: ./test-W200-normalized.graph: No such file or directory rm: cannot remove./test-W200-normalized.graph': No such file or directory

Find candidate islands exhibiting clustering ... python /ifs/home/xx/utilities/SICER/src/find_islands_in_pr.py -s hg18 -b ./test-W200.graph -w 200 -g 600 -t 0.74 -e 1000 -f ./test-W200-G600.scoreisland Traceback (most recent call last): File "/ifs/home/xx/utilities/SICER/src/find_islands_in_pr.py", line 24, in import SeparateByChrom # GenomeData File "/ifs/home/xx/utilities/SICER/lib/SeparateByChrom.py", line 141 print file, " file does not exist." ^ SyntaxError: Missing parentheses in call to 'print'

Calculate significance of candidate islands using the control library ... python /ifs/home/xx/utilities/SICER/src/associate_tags_with_chip_and_control_w_fc_q.py -s hg18 -a ./test-1-removed.bed -b ./control-1-removed.bed -d ./test-W200-G600.scoreisland -f 150 -t 0.74 -o ./test-W200-G600-islands-summary File "/ifs/home/xx/utilities/SICER/src/associate_tags_with_chip_and_control_w_fc_q.py", line 54 print "This species is not recognized, exiting"; ^ SyntaxError: Missing parentheses in call to 'print'

Identify significant islands using FDR criterion ... python /ifs/home/xx/utilities/SICER/src/filter_islands_by_significance.py -i ./test-W200-G600-islands-summary -p .01 -c 7 -o ./test-W200-G600-islands-summary-FDR.01 File "/ifs/home/xx/utilities/SICER/src/filter_islands_by_significance.py", line 48 print "Given significance", opt.significance, ", there are", totalislands, "significant islands"; ^ SyntaxError: Missing parentheses in call to 'print'

Convert island summary to island bed file of format chr start end ChIP-read-count python /ifs/home/xx/utilities/SICER/utility/convert_summary_to_bed.py -i ./test-W200-G600-islands-summary-FDR.01 -o ./test-W200-G600-FDR.01-island.bed Traceback (most recent call last): File "/ifs/home/xx/utilities/SICER/utility/convert_summary_to_bed.py", line 52, in main(sys.argv) File "/ifs/home/xx/utilities/SICER/utility/convert_summary_to_bed.py", line 38, in main file = open(opt.islandsummaryfile,'r') FileNotFoundError: [Errno 2] No such file or directory: './test-W200-G600-islands-summary-FDR.01'

Filter reads with identified significant islands... python /ifs/home/xx/utilities/SICER/utility/filter_raw_tags_by_islands.py -s hg18 -a ./test-1-removed.bed -i 150 -b ./test-W200-G600-FDR.01-island.bed -o ./test-W200-G600-FDR.01-islandfiltered.bed File "/ifs/home/xx/utilities/SICER/utility/filter_raw_tags_by_islands.py", line 96 print "This species is not recognized, exiting"; ^ SyntaxError: Missing parentheses in call to 'print'

Make summary graph with filtered reads... python /ifs/home/xx/utilities/SICER/src/run-make-graph-file-by-chrom.py -s hg18 -b ./test-W200-G600-FDR.01-islandfiltered.bed -w 200 -i 150 -o ./test-W200-G600-FDR.01-islandfiltered.graph File "/ifs/home/xx/utilities/SICER/src/run-make-graph-file-by-chrom.py", line 27 print "Can not find the length of ", chrom; ^ SyntaxError: Missing parentheses in call to 'print'

Normalize summary graph with filtered reads for test by total island filtered reads per million... python /ifs/home/xx/utilities/SICER/src/normalize.py -i ./test-W200-G600-FDR.01-islandfiltered.graph -a 3 -t 1000000 -o ./test-W200-G600-FDR.01-islandfiltered-normalized.graph Traceback (most recent call last): File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 60, in main(sys.argv) File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 55, in main total = total_counts(opt.input_file, opt.colum) / opt.ScalingFactor File "/ifs/home/xx/utilities/SICER/src/normalize.py", line 32, in total_counts infile = open(file,'r') FileNotFoundError: [Errno 2] No such file or directory: './test-W200-G600-FDR.01-islandfiltered.graph'

Convert the summary graph made with the filtered reads into wig vstep format and normalize by total island-filtered read count per million... sh /ifs/home/xx/utilities/SICER/src/variableStep.sh ./test-W200-G600-FDR.01-islandfiltered-normalized.graph ./test-W200-G600-FDR.01-islandfiltered-normalized.wig test 200 head: cannot open ./test-W200-G600-FDR.01-islandfiltered-normalized.graph' for reading: No such file or directory grep: ./test-W200-G600-FDR.01-islandfiltered-normalized.graph: No such file or directory rm: cannot remove./test-W200-G600-FDR.01-islandfiltered.graph': No such file or directory rm: cannot remove `./test-W200-G600-FDR.01-islandfiltered-normalized.graph': No such file or directory

Done!

dariober commented 7 years ago

Hi-

~/utilities/SICER/SICER.sh ./ test.bed control.bed . hg18 1 200 150 0.74 600 .01

It seems to me your trying to run the "original" sicer, not my wrapper called sicer.py. Maybe you want to post your question on the sicer mailing list instead or switch to sicer.py?

Anyway, it seems your running sicer using python 3 insteda of python 2. This causes problems due to incompatibilitie between 2 and 3. I think the errors SyntaxError: Missing parentheses in call to 'print' are due to this. Try running it using python 2 (2.7 probably best).

gongyixiao commented 7 years ago

Hi, there,

Thanks very much for your help. You are right about the python version. I changed the version back to 2.7+ and it works now!

Thanks.