+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- Changed for loop to each in create_pedigree_file [#683](https://github.com/nf-core/raredisease/pull/683)

### `Fixed`

### Parameters
Expand Down
7 changes: 3 additions & 4 deletions modules/local/create_pedigree_file/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ process CREATE_PEDIGREE_FILE {

script:
def case_name = samples[0].case_id
def out = new File(case_name + ".ped")
outfile_text = ['#family_id', 'sample_id', 'father', 'mother', 'sex', 'phenotype'].join('\\t')
def samples_list = []
for(int i = 0; i<samples.size(); i++) {
def sample_name = samples[i].sample
samples.each { sample ->
def sample_name = sample.sample
if (!samples_list.contains(sample_name)) {
outfile_text += "\\n" + [samples[i].case_id, sample_name, samples[i].paternal, samples[i].maternal, samples[i].sex, samples[i].phenotype].join('\\t')
outfile_text += "\\n" + [sample.case_id, sample_name, sample.paternal, sample.maternal, sample.sex, sample.phenotype].join('\\t')
Comment on lines +24 to +27
Copy link
Collaborator

Choose a reason for hiding this comment

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

Elegant 👌

samples_list.add(sample_name)
}
}
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载