I have a directory with a bunch of files
Ex:
ExperimentA_Rep1.bed
ExperimentA_Rep2.bed
ExperimentA_Rep3.bed
ExperimentB_Rep1.bed
ExperimentD_Rep1.bed
ExperimentC_Rep1.bed
ExperimentC_Rep2.bed
.
.
.
ExperimentZ_Rep5.bed
I need to scan through the filenames in a directory and concatenate the files that are from the same experiment, but different replicates, into a new file.
I.e
cat ExperimentA_Rep1.bed ExperimentA_Rep2.bed > ExperimentA_merged.bed
If the Experiment only has 1 replicate, it should not do anything. But I can't hardcode this, it needs to be applicable for any dataset of experiments.
If I ran a python script that would be okay.
No comments:
Post a Comment