0
0
Entering edit mode
20 months ago
Yihan • 0

I'm trying to create a matrix from the raw counts of genes.

Here is the script. It's a nano file and I ran it with srun command.

#!/bin/bash

#SBATCH --mem=64G   for i in *ReadsPerGene.out.tab;

cut -f1,4 $i | grep -v "_" > data/deseq2/counts_4thcol/basename$i

done


Because I got "permission denied" error from running this nano file, I tried to run it line by line. However, then I got this error

 -bash: syntax error near unexpected token cut'


I'm wondering what I can do to make cut be recognized?

star • 915 views
0
Entering edit mode
 for i in *ReadsPerGene.out.tab; do cut ...

0
Entering edit mode

Thank you. I tried this, and seems like the file is created but I got this:

-bash: data/deseq2/counts_4thcol/E2715-CSC_S35_merged_counts.txt: No such file or directory

0
Entering edit mode

0
Entering edit mode
for i in_alignment/*ReadsPerGene.out.tab;
do
cut -f1,4 $i | grep -v "_" > data/deseq2/counts_4thcol/basename$i ReadsPerGene.out.tab_counts.txt;
done
`
0
Entering edit mode

Can you get this to work without the loop?

0
Entering edit mode

Yes. I figured it out! Thank you

0
Entering edit mode

What was the problem?