Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cl3mente committed Jun 18, 2024
2 parents 73fbad3 + 7046a7b commit a197016
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Copy the compatible ParaAT version
run: cp -f /app/ParaAT.pl /app/ParaAT2.0/ParaAT.pl
- name: Build the Docker image
run: docker build . --file Dockerfile --tag dualhgt:$(date +%s)
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push the Docker image
run: |
docker push dualhgt:$(date +%s)
docker push dualhgt:${{ github.sha }}
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ RUN apt-get install -y locate libc6 muscle
#USER appuser

# Copy the source code into the container.
COPY . .
RUN git clone https://github.com/cl3mente/PlantPath2023.git

RUN cp -f /app/PlantPath2023/ParaAT.pl /app/ParaAT2.0/ParaAT.pl

ENV PATH=$PATH:/app/KaKs_Calculator3.0/src:/app/ParaAT2.0:/app/OrthoFinder

RUN mkdir input

RUN cp -f /app/ParaAT.pl /app/ParaAT2.0/ParaAT.pl


VOLUME /app/input
# CMD python HGT.py -i /data/bioinf2023/PlantPath2023/genomeANDgff -OFr /data/bioinf2023/PlantPath2023/genomeANDgff/results/prot/f7b812/Results_Feb23 -v -nt 50
#ENTRYPOINT ["python","./HGT.py", "-i", "input"]
#ENTRYPOINT ["python","./HGT.py", "-i", "input"]
6 changes: 4 additions & 2 deletions dualHGT.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,9 @@ def getHGT(matrix, gene_association):
matrix2 = append_species(matrix, gene_association)

# remove NAs
matrix2 = matrix2[matrix2['dist'] != "NA"]
#matrix2 = matrix2[matrix2['dist'] != "NA"]
matrix2[matrix2['dist'] == "NA"] = 0

matrix2['dist'] = pd.to_numeric(matrix2['dist'], downcast='float')

# initialize an empty column for the HGT score
Expand Down Expand Up @@ -924,7 +926,7 @@ def prepare_input(arg):
except FileExistsError:
print(f"Folder '{output_folder}' already exists. Wait a second??")

logfile = os.path.join(output_folder, 'log.txt')
logfile = os.path.join(output_folder, f'log_{current_date}.txt')
logfile = open(logfile, 'w')

def write_and_log(msg):
Expand Down
5 changes: 3 additions & 2 deletions dualHGT/dualHGT/dualHGT.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def kaksparallel(file: str) -> list:
if not os.path.exists(output) or not os.path.getsize(output) > 0:
runkaks = KAKS % (file, #the .axt file passed as input
output, # the output file
"NG") # NG is the model used for the calculation
"MA") # Model Averaging is used for the calculation
run = subprocess.Popen(runkaks, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)

out, err = run.communicate()
Expand Down Expand Up @@ -771,7 +771,8 @@ def getHGT(matrix, gene_association):
matrix2 = append_species(matrix, gene_association)

# remove NAs
matrix2 = matrix2[matrix2['dist'] != "NA"]
# matrix2 = matrix2[matrix2['dist'] != "NA"]
matrix2[matrix2['dist'] == "NA"] = 0
matrix2['dist'] = pd.to_numeric(matrix2['dist'], downcast='float')

# initialize an empty column for the HGT score
Expand Down

0 comments on commit a197016

Please sign in to comment.