Knowledge base

Contruct 10X directory from GEO muliple files

Introduction

The processed scRNA data dowloaded from GEO were alwalys like this.

Files of multiple samples were deposited together. But actually what we want is like follows:

Code exmaple

cd data/GSE184362  # Switch to data directory
ls *matrix.mtx.gz | awk '{split($1,a, "_matrix");printf "mkdir "a[1]"; ""mv "a[1]"* ./"a[1]"/\n"}' > script.sh
ls | grep GSM | awk '{printf "mv "$1"/"$1"_barcodes.tsv.gz "$1"/barcodes.tsv.gz; mv "$1"/"$1"_features.tsv.gz "$1"/features.tsv.gz; mv "$1"/"$1"_matrix.mtx.gz "$1"/matrix.mtx.gz\n"}' > script2.sh
bash script.sh
bash script2.sh

References

None

Original

None

Leave a Reply

Your email address will not be published. Required fields are marked *