Skip to content

Commit 152516e

Browse files
committed
Fix: Updating sample sheet script to remove whitespace.
1 parent 88924e1 commit 152516e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

workflow/scripts/create_sample_sheet.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,16 @@ def parse_groups(input_file, search_group, skip_header=True, delim='\t'):
121121
multiple_groups = [clean(g.strip()) for g in multiple_groups]
122122
if search_group in multiple_groups:
123123
# Got a hit print formatted line
124-
# with sample, group, and N covariates
124+
# with sample, group, and N covariates,
125+
# Make sure any white spaces are removed.
126+
covariates = "\t".join([cv.replace(" ", "") for cv in linelist[2:]])
127+
if covariates:
128+
covariates = "\t{0}".format(covariates)
125129
print(
126-
"{}\t{}\t{}".format(
127-
linelist[0], # sample column
128-
search_group, # group column
129-
"\t".join(linelist[2:]) # N remaining columns (covariates)
130+
"{0}\t{1}{2}".format(
131+
linelist[0], # sample column
132+
search_group.replace(" ", ""), # group column
133+
covariates # N remaining columns (covariates)
130134
)
131135
)
132136

@@ -184,4 +188,4 @@ def main():
184188

185189
if __name__ == '__main__':
186190
# Call main method
187-
main()
191+
main()

0 commit comments

Comments
 (0)