#!/bin/bash
#csv_to_tsv.sh

#create list of file names
ls ./Filtered_gene_list > files
#remove .csv
sed 's/.csv//g' files

#change csv to tsv (not sure if this code works- will need to rename files to w/o .csv)
cat files | while read filename;
do
cd ./Filtered_gene_list
sed -i 's/,/	/g'  "$filename"
# filter genes with FDR < 0.05 and log^2FC > 1.5
awk '{if(($2 > 1.5 && $5 < 0.05) || ($2 < -1.5 && $5 < 0.05)) print $0}' "$filename" > sig_"$filename"
cd ../
done
