Skip to content

Commit b71ab4e

Browse files
committed
fix meta.name being null when using accessions and sample sheets
1 parent bf9a9ad commit b71ab4e

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

.vscode/settings.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,27 @@
33
"cSpell.words": [
44
"Appender",
55
"bakta",
6+
"Bjorn",
67
"blastdb",
8+
"cercise",
9+
"Depresso",
10+
"Dumpty",
11+
"experi",
712
"fastani",
813
"fofn",
14+
"Graaaaaains",
15+
"Humpty",
16+
"impasta",
17+
"irrelephant",
18+
"maybee",
19+
"Neptunes",
20+
"Peachtree",
921
"phix",
10-
"staphopia"
22+
"Piiig",
23+
"quacker",
24+
"staphopia",
25+
"stega",
26+
"Thunderwear"
1127
],
1228
"java.configuration.updateBuildConfiguration": "interactive"
1329
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies {
99
implementation 'com.sanctionco.jmail:jmail:1.6.3' // Needed for e-mail format validation
1010
}
1111

12-
version = '1.0.0'
12+
version = '1.0.1'
1313

1414
nextflowPlugin {
1515
nextflowVersion = '25.04.0'

src/main/groovy/bactopia/plugin/BactopiaMotD.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BactopiaMotD {
1717
"Learn more about Bactopia at https://bactopia.github.io/",
1818
"Feeling stuck? Check out the docs at https://bactopia.github.io/",
1919
"Bactopia is a pipeline for the analysis of bacterial genomes.",
20-
"Bactopia was first released in Feburary 2019.",
20+
"Bactopia was first released in February 2019.",
2121
"Bactopia is based on Staphopia which was specific to Staphylococcus aureus.",
2222
"Found a bug? Report it at https://github.com/bactopia/bactopia/issues",
2323
"Have a feature request? Open an issue at https://github.com/bactopia/bactopia/issues",
@@ -26,6 +26,8 @@ class BactopiaMotD {
2626
"Atlanta, Georgia has the highest percentage of tree canopy of any city in the United States.",
2727
"There are 71 variations of 'Peachtree' streets in Atlanta, Georgia.",
2828
"Wyoming is the least populous state in the United States. (~600k in 2025)",
29+
"Wyoming has approximately 2.15 to 2.4 cows per person, the highest ratio of any U.S. state.",
30+
"Wyoming is home to two escalators.",
2931

3032
// Jokes
3133
"How does a penguin build its house? ${colors.cyan}${colors.italic}Igloos it together!${colors.reset}",
@@ -62,7 +64,7 @@ class BactopiaMotD {
6264
"What do you call a pig with three eyes? ${colors.cyan}${colors.italic}Piiig!${colors.reset}",
6365
"What do you call a pile of cats? ${colors.cyan}${colors.italic}A meow-tain!${colors.reset}",
6466
"What do you call a snowman with a six-pack? ${colors.cyan}${colors.italic}An abdominal snowman!${colors.reset}",
65-
"What do you call an elephant that doesnt matter? ${colors.cyan}${colors.italic}An irrelephant!${colors.reset}",
67+
"What do you call an elephant that doesn't matter? ${colors.cyan}${colors.italic}An irrelephant!${colors.reset}",
6668
"What do you call an old snowman? ${colors.cyan}${colors.italic}Water!${colors.reset}",
6769
"What does an angry pepper do? ${colors.cyan}${colors.italic}It gets jalapeño business!${colors.reset}",
6870
"What does a cloud wear under his raincoat? ${colors.cyan}${colors.italic}Thunderwear!${colors.reset}",
@@ -93,6 +95,12 @@ class BactopiaMotD {
9395
"What did the triangle say to the circle? ${colors.cyan}${colors.italic}You're so pointless!${colors.reset}",
9496
"What happens when a snowman throws a tantrum? ${colors.cyan}${colors.italic}He has a meltdown!${colors.reset}",
9597
"What do you call a bear with no teeth? ${colors.cyan}${colors.italic}A gummy bear!${colors.reset}",
98+
"Humpty Dumpty had a great fall. ${colors.cyan}${colors.italic}Summer wasn't too bad either!${colors.reset}",
99+
"There are two reasons not to drink toilet water. ${colors.cyan}${colors.italic}Number one and number two!${colors.reset}",
100+
"Why couldn't Pseudomonas get backstage at the concert? ${colors.cyan}${colors.italic}Because it was Staph only!${colors.reset}",
101+
"No matter how popular antibiotics get, ${colors.cyan}${colors.italic}they will never go viral!${colors.reset}",
102+
"What do call a bacterium that can swim fast? ${colors.cyan}${colors.italic}micro-Phelps!${colors.reset}",
103+
"How do you turn soup into gold? ${colors.cyan}${colors.italic}Add 24 carrots!${colors.reset}",
96104
]
97105
def random = new Random()
98106
def index = random.nextInt(messages.size())

src/main/groovy/bactopia/plugin/inputs/Bactopia.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Bactopia {
9797
/* Parse line and determine if single end or paired reads*/
9898
def Map meta = [:]
9999
meta.id = line.sample
100-
meta.name = params.sample
100+
meta.name = line.sample
101101
meta.runtype = line.runtype
102102

103103
if (params.genome_size) {
@@ -186,14 +186,14 @@ class Bactopia {
186186

187187
if (line.accession.startsWith('GCF') || line.accession.startsWith('GCA')) {
188188
meta.id = line.accession.split(/\./)[0]
189-
meta.name = params.sample
189+
meta.name = line.accession.split(/\./)[0]
190190
meta.runtype = "assembly_accession"
191191
meta.genome_size = params.genome_size
192192
meta.species = params.species
193193
return [meta, [params.empty_r1], [params.empty_r2], params.empty_extra]
194194
} else if (line.accession.startsWith('DRX') || line.accession.startsWith('ERX') || line.accession.startsWith('SRX')) {
195195
meta.id = line.accession
196-
meta.name = params.sample
196+
meta.name = line.accession
197197
meta.runtype = line.runtype == 'ont' ? "sra_accession_ont" : "sra_accession"
198198

199199
// if genome_size is provided, use it, otherwise use the genome_size from the FOFN
@@ -225,11 +225,11 @@ class Bactopia {
225225
if (accession.length() > 0) {
226226
if (accession.startsWith('GCF') || accession.startsWith('GCA')) {
227227
meta.id = accession.split(/\./)[0]
228-
meta.name = params.sample
228+
meta.name = accession.split(/\./)[0]
229229
meta.runtype = "assembly_accession"
230230
} else if (accession.startsWith('DRX') || accession.startsWith('ERX') || accession.startsWith('SRX')) {
231231
meta.id = accession
232-
meta.name = params.sample
232+
meta.name = accession
233233
meta.runtype = params.ont ? "sra_accession_ont" : "sra_accession"
234234
} else {
235235
log.error(

0 commit comments

Comments
 (0)