Skip to content

sprocket format overwrite the repo#303

Draft
a-frantz wants to merge 3 commits intomainfrom
formatting
Draft

sprocket format overwrite the repo#303
a-frantz wants to merge 3 commits intomainfrom
formatting

Conversation

@a-frantz
Copy link
Member

Describe the problem or feature in addition to a link to the issues.

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • The code passes all CI tests without any errors or warnings.
  • You have added tests (when appropriate).
  • You have added an entry in any relevant CHANGELOGs (when appropriate).
  • If you have made any changes to the scripts/ or docker/ directories, please ensure any image versions have been incremented accordingly!
  • You have updated the README or other documentation to account for these changes (when appropriate).

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Member

@adthrasher adthrasher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these comments are based on the first commit.

Comment on lines +204 to +205
Int disk_size_gb = bam_size_gb + ceil(size(gtf, "GB")) + ceil(size(reference_fasta_gz,
"GB")) + modify_disk_size_gb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't that bad, but I'd almost prefer to treat addition chains similarly to arrays and line break on each element. This line break makes sense to me as it is the first available break that doesn't exceed the line length, but it feels weird to break in the middle of the size call inside of a ceil and within the + operator.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe length of chain should be considered? Something like "if more than N (3? 4?) binary operators in a chain, line break on each"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is superseded by the "priority list" and "clauses" discussion we've had.

tools/arriba.wdl Outdated
Comment on lines +201 to +230
~{(
if length(interesting_contigs) > 0
then "-i " + sep(",", quote(interesting_contigs))
else ""
)} \
~{(
if length(viral_contigs) > 0
then "-v " + sep(",", quote(viral_contigs))
else ""
)} \
~{(
if length(disable_filters) > 0
then "-f " + sep(",", quote(disable_filters))
else ""
)} \
~{(if length(interesting_contigs) > 0 then "-i " + sep(",", quote(
interesting_contigs
)) else "")} \
~{(if length(viral_contigs) > 0 then "-v " + sep(",", quote(viral_contigs))
else "")} \
~{(if length(disable_filters) > 0 then "-f " + sep(",", quote(disable_filters)
) else "")} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar thoughts here.

tools/bwa.wdl Outdated
Comment on lines +39 to +40
String prefix = sub(
basename(fastq),
"(([_.][rR](?:ead)?[12])((?:[_.-][^_.-]*?)*?))?\\.(fastq|fq)(\\.gz)?$",
String prefix = sub(basename(fastq), "(([_.][rR](?:ead)?[12])((?:[_.-][^_.-]*?)*?))?\\.(fastq|fq)(\\.gz)?$",
"" # Once replacing with capturing groups is supported, replace with group 3
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

tools/bwa.wdl Outdated
Comment on lines +50 to +51
Int disk_size_gb = (ceil((input_fastq_size + reference_size) * 2) + 10 + modify_disk_size_gb
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really unfortunate line break.

Comment on lines +123 to +125
--java-options "-XX:GCTimeLimit=50 -XX:GCHeapFreeLimit=10 -Xms4000m -Xmx~{
java_heap_size
}g" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads awkwardly to me with the line breaks.

Comment on lines +99 to +100
Int disk_size_gb = ((if library_name == "bacteria" then 300 else if library_name == "nr"
then 600 else if library_name == "nt" then 2500 else 25) + modify_disk_size_gb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This impacts readability.

Comment on lines +63 to +64
Int num = (if merge_num > 0 then probe_num + (merge_num * max_length) else probe_num
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also an awkward break.

Comment on lines +124 to +129
if ((length(kraken_fastas) > 0) || (length(kraken_fasta_urls) > 0) || (length(
kraken_libraries
) > 0)) {
call kraken2.download_taxonomy { input:
protein,
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need to create a priority list of tokens for line breaking. Using this example, I'd prefer to backtrack and line break around || so that the entire clause (length(kraken_libraries) > 0) remains on a single line.

Copy link
Member

@adthrasher adthrasher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments based on the second commit.

Comment on lines 50 to +51
Int disk_size_gb = (ceil((input_fastq_size + reference_size) * 2) + 10 + modify_disk_size_gb
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the indents is good. It'd be great to avoid dangling closures though.

tools/star.wdl Outdated
Comment on lines +771 to +773
--clip3pAdapterMMp ~{clip_3p_adapter_mmp.left} ~{(if (length(read_twos) != 0)
then clip_3p_adapter_mmp.right else None)} \
then clip_3p_adapter_mmp.right
else None)} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks better to me.

Comment on lines -250 to +266
~{if mark_duplicates then "" else "-u"} \
~{if report_additional_columns then "-X" else ""} \
~{if fill_gaps then "-I" else ""}
~{if mark_duplicates
then ""
else "-u"
} \
~{if report_additional_columns
then "-X"
else ""
} \
~{if fill_gaps
then "-I"
else ""
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried about this change being too awkward for short clauses, but I think even this one looks pretty good here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I think this is OK even for these short clauses and statements that could be single lines.

]))} \
--clip3pAdapterSeq "~{clip_3p_adapter_seq.left}" ~{(if (length(read_twos) != 0
) then "'" + clip_3p_adapter_seq.right + "'" else "")} \
--clip3pAdapterSeq "~{clip_3p_adapter_seq.left}" ~{(if (length(read_twos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this line got an extra level of indent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh. That's a strange one. I don't have an immediate answer as to how this happened

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop. I did something that broke idempotency. There are extra indents being added each time I run this code 😅 This appears to be the only odd case in this commit, but I'm seeing some others locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was another instance down a few lines, but it sounds like you've got the cause figured out already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants