Adding read groups to collection


I have a paired-end collection (~100 samples) which I want to map with bwa mem. I want to add custom read groups to the collection in an automated way (not one by one manually) . The bwa tool page offers an option to add read groups automatically but it only uses the item name in the collection, which I don’t want. For a nested collection it just adds the last element name which is quite dangerous in my case. E.g case/case1/rep1 and control/control1/rep1 , the read group added is rep1 in both cases.
I would be grateful to know if

  • Is it possible to use group tags (other dataset tags which can be set in rule based collection builder) to add read groups to a collection. This would make life very easy
  • Is there any other way to automatically add custom read groups (not just from the name of the file). Manual option does not work due to high number of samples.

Many Thanks!

Hi @microfuge
are you after something like this:Name tags for following complex histories ?
Kind regards,

Hi Igor,

Thanks for the link! Name tags are a great feature of Galaxy as our users get lost (me included) even in a small sized history.

I want to know if there is an automated way to add read groups to bam files other than using the file name itself and can a name tag itself be used for this.

I find name tags in general not useful for collections (as they are not displayed in items of collection) (E.g I added name tags but the image below is shown when I click inside the collection)

Hi @microfuge
a simplest option might be through the file name, assuming the samples have short names. The read files can be named during rules based upload, or files in a collection can be renamed.
Another option might be available through Galaxy workflow. Workflow supports additional inputs. For example, by default RG identifier is typed manually or ‘recorded’ in a workflow, but this filed can be converted to ‘input’, so it also can take a value from ‘input box’. I understand this is very confusing description. Maybe check these tutorials:

I don’t know if tags can be used as input value for read groups. Read groups are used for a particular datatype, while Galaxy tags are universal.

Kind regards