Skip to content

Commit

Permalink
import changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ens-ftricomi committed Aug 15, 2024
1 parent ba5f451 commit 978feea
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ process INDEX_GENOME {
// Initialize variables
def numberOfReferences = 0
def genomeLength = 0
// Read the FASTA file line by line
genomefilePath.eachLine { line ->
if (line.startsWith('>')) {
numberOfReferences++
} else {
def retryCount = 0
def maxRetries = 3
def filesValid = false
while (!filesValid && retryCount < maxRetries) {
// Read the FASTA file line by line
genomefilePath.eachLine { line ->
if (line.startsWith('>')) {
numberOfReferences++
} else {
genomeLength += line.trim().length()
}
}
Expand All @@ -66,6 +70,10 @@ process INDEX_GENOME {
// Calculate the genome length (excluding header lines)
//def genomeLength = fastaContent.split('\n').findAll { !it.startsWith('>') }.join('').length()

if (genomeLength != 0) {
filesValid = true
}
}
// Define read length (you may need to adjust this based on your data)
def readLength = 100

Expand Down Expand Up @@ -97,6 +105,4 @@ process INDEX_GENOME {
"""
}

}


}

0 comments on commit 978feea

Please sign in to comment.