Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SARS-CoV-2 verison of RAMPART #1

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
45640ed
created python scripts and snakemake files for detection of SARS-COV-…
janka000 May 2, 2021
68145fa
adding strand matching pipeline to server scripts
janka000 May 2, 2021
74c38ff
showing variant data on front-end
janka000 May 2, 2021
169e17a
moving old docs and examples to /old folder
janka000 May 2, 2021
6d2c7b9
added new docs and SARS-CoV-2 protocols
janka000 May 2, 2021
6783cf4
added new environment file
janka000 May 2, 2021
3867c67
removing comments and fixing code style&formatting
janka000 May 2, 2021
f70b095
I figured out that we need the if statement we removed
janka000 May 3, 2021
4465258
added new screenshots
janka000 May 3, 2021
acdab22
removing custom configuration
janka000 May 3, 2021
1bfdd05
removing __pycache__
janka000 May 3, 2021
2b37599
moving pipleines to separate folder and restoring EBOLA examples
janka000 May 4, 2021
681249e
removing default_protocol from /old folder
janka000 May 4, 2021
8e4b169
removing forgotten changes
janka000 May 4, 2021
ba32447
tidying up
janka000 May 5, 2021
412c26b
tidying up python scripts + requested changes
janka000 May 5, 2021
199ca87
new mutations file + some additional info in json
janka000 May 6, 2021
bba5d22
another requested changes
janka000 May 7, 2021
e955c8a
small fix
janka000 May 10, 2021
119a3ce
variantsTree maybe fixed
janka000 May 14, 2021
981fd70
fixing whitespaces and mutationsTree
janka000 May 14, 2021
1d03b3b
annotatedPath fix
janka000 May 16, 2021
cebd4ea
added log files for variant calling pipeline
janka000 Jul 27, 2021
4cba686
added support for structure with csv in subfolders to strand_matching…
janka000 Jul 27, 2021
9ad8c7e
added support for gziped fastq files in variant calling pipeline
janka000 Jul 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions src/components/Charts/mutationsTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,22 @@ class MutationsTree extends React.Component {
this.state = {};
}

createVariants(variants, level){
return variants.flatMap((variant) => [
createVariants = (variants, level) => {
return (variants.flatMap((variant) => [
`${'---'.repeat(level)}variant: ${variant.name} (${variant.mutations.map(mutation=>mutation.from+mutation.position+mutation.to).join(", ")})`,
...this.createVariants(variant.subs, level+1)
])
}


componentDidMount() {
let variantsTree = this.createVariants(this.props.data, 0).map(i => {
])).map(i => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this correct? createVariants is recursive, and this therefore <p> escapes recursively. Is that what we want?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, you are right, this might be a problem. maybe if we seperated the second map to the second function, it might by okay.

return <p>{i}</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't react complaining that array elements don't have any key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it doesn't, as far as I can see

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure? Doesn't it output warnings to the console in the runtime? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, I see only the log outputs which were there in original rampart too.

});
this.setState({data:variantsTree});
}

componentDidUpdate(prevProps) {
this.render();
}



render() {
return (
<Container width="90%" ref="">
<Title>
{"Mutations tree"}
</Title>
{this.state.data}
{this.createVariants(this.props.data, 0)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what about this? isn't it the simplest way how to achieve what we want, without using hooks, etc?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, assuming this is performant enough (I have no idea whether the caching in previous version was because of performance or not).

Anyway, this looks good, let's just rename it to renderVariants

{this.props.renderProp ? this.props.renderProp : null}
</Container>
)
Expand Down