Skip to content

Commit

Permalink
fix: lots of fixes. Mainly py2 -> py3
Browse files Browse the repository at this point in the history
  • Loading branch information
a-frantz committed Nov 18, 2023
1 parent 10eca10 commit 00648ca
Show file tree
Hide file tree
Showing 33 changed files with 38 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import sys
Expand Down Expand Up @@ -117,7 +117,7 @@
got_feature_list = True
print("done getting features")
samples_ordered = []
for key, value in sorted(samples.items(), key=lambda k, v: (v, k)):
for key, value in sorted(samples.items(), key=lambda kv: kv[1]):
samples_ordered.append(key)
header_line = count_header_list[0]
for s in samples_ordered:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import re

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ main() {

default_scale=0
if [ "$scale" == "$default_scale" ]; then
scale=$(python -c "print float(10**7)/float($counts)")
scale=$(python3 -c "print(float(10**7)/float($counts))")
else
scale=1
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
from decimal import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
set -e -x -o pipefail

main() {
python -m pip install --no-cache-dir --upgrade pip~=20.3.4
python -m pip install --no-cache-dir --no-python-version-warning --upgrade setuptools~=44.1
python -m pip install --no-cache-dir --no-python-version-warning functools32~=3.2
python -m pip install --no-cache-dir --no-python-version-warning numpy==1.16.6
python -m pip install --no-cache-dir --no-python-version-warning matplotlib==2.2.5
python -m pip install --no-cache-dir --no-python-version-warning pysam==0.16.0.1
python -m pip install --no-cache-dir --no-python-version-warning HTSeq==0.12.4
python3 -m pip install --no-cache-dir HTSeq
wget -nv -O jq-1.6 https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x ./jq-1.6

Expand All @@ -33,7 +27,7 @@ main() {
if [ -n "$gene_length_file" ] && [ "$id_attribute" = "gene_name" ]; then
fpkm_file=$prefix.fpkm.txt
fpkmlog2File=$prefix.fpkm.log2.txt
python /usr/bin/calc_fpkm.py "$out_name" "$gene_length_file_path" "$fpkm_file" "$fpkmlog2File"
python3 /usr/bin/calc_fpkm.py "$out_name" "$gene_length_file_path" "$fpkm_file" "$fpkmlog2File"

dx mkdir -p FPKM
fpkm=$(dx upload --path FPKM/ "$fpkm_file" --brief)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import yaml
import sys
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_bam/resources/usr/bin/create_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# warden_python 1.1.0


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import openpyxl
import csv
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_bam/resources/usr/bin/process_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_bam/src/warden.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ main() {
if [ "$sample_list_extension" == "txt" ]; then
dos2unix -q sample_list.txt
elif [ "$sample_list_extension" == "xlsx" ]; then
python /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
python3 /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
else
dx-jobutil-report-error "Improper Sample List Extension. This should be a .txt or .xlsx file" AppError
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import sys
Expand Down Expand Up @@ -117,7 +117,7 @@
got_feature_list = True
print("done getting features")
samples_ordered = []
for key, value in sorted(samples.items(), key=lambda k, v: (v, k)):
for key, value in sorted(samples.items(), key=lambda kv: kv[1]):
samples_ordered.append(key)
header_line = count_header_list[0]
for s in samples_ordered:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import yaml
import sys
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_counts/resources/usr/bin/create_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# warden_python 1.1.0


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import openpyxl
import csv
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_counts/resources/usr/bin/process_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_counts/src/warden.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ main() {
if [ "$sample_list_extension" == "txt" ]; then
dos2unix -q sample_list.txt
elif [ "$sample_list_extension" == "xlsx" ]; then
python /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
python3 /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
else
dx-jobutil-report-error "Improper Sample List Extension. This should be a .txt or .xlsx file" AppError
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import sys
Expand Down Expand Up @@ -117,7 +117,7 @@
got_feature_list = True
print("done getting features")
samples_ordered = []
for key, value in sorted(samples.items(), key=lambda k, v: (v, k)):
for key, value in sorted(samples.items(), key=lambda kv: kv[1]):
samples_ordered.append(key)
header_line = count_header_list[0]
for s in samples_ordered:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import re

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main() {

default_scale=0
if [ "$scale" == "$default_scale" ]; then
scale=$(python -c "print float(10**7)/float($counts)")
scale=$(python3 -c "print(float(10**7)/float($counts))")
else
scale=1
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
from decimal import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
set -e -x -o pipefail

main() {
python -m pip install --no-cache-dir --upgrade pip~=20.3.4
python -m pip install --no-cache-dir --no-python-version-warning --upgrade setuptools~=44.1
python -m pip install --no-cache-dir --no-python-version-warning functools32~=3.2
python -m pip install --no-cache-dir --no-python-version-warning numpy==1.16.6
python -m pip install --no-cache-dir --no-python-version-warning matplotlib==2.2.5
python -m pip install --no-cache-dir --no-python-version-warning pysam==0.16.0.1
python -m pip install --no-cache-dir --no-python-version-warning HTSeq==0.12.4
python3 -m pip install --no-cache-dir HTSeq
wget -nv -O jq-1.6 https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x ./jq-1.6

Expand All @@ -33,7 +27,7 @@ main() {
if [ -n "$gene_length_file" ] && [ "$id_attribute" = "gene_name" ]; then
fpkm_file=$prefix.fpkm.txt
fpkmlog2File=$prefix.fpkm.log2.txt
python /usr/bin/calc_fpkm.py "$out_name" "$gene_length_file_path" "$fpkm_file" "$fpkmlog2File"
python3 /usr/bin/calc_fpkm.py "$out_name" "$gene_length_file_path" "$fpkm_file" "$fpkmlog2File"

dx mkdir -p FPKM
fpkm=$(dx upload --path FPKM/ "$fpkm_file" --brief)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import yaml
import sys
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_fastq/resources/usr/bin/create_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# warden_python 1.1.0


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import openpyxl
import csv
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_fastq/resources/usr/bin/process_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion stjude_warden_fastq/src/warden.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ main() {
if [ "$sample_list_extension" == "txt" ]; then
dos2unix -q sample_list.txt
elif [ "$sample_list_extension" == "xlsx" ]; then
python /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
python3 /usr/bin/parse_excel_sample_list.py sample_list.xlsx > sample_list.txt
else
dx-jobutil-report-error "Improper Sample List Extension. This should be a .txt or .xlsx file" AppError
fi
Expand Down

0 comments on commit 00648ca

Please sign in to comment.