basedir="/home/venus/mar/share_pesquisa/debora_veniamin/GemeosDiscordantes_TAOS"; bams=$(find $basedir -name "*.bam");
for i in $bams
do
#     echo $i;
    bn=$(basename $i)
    splitext=$(echo $bn | cut -d "." -f1)
#     echo $bn $splitext
    mkdir $splitext
     ln -s $i $splitext/${splitext}.bam
     samtools index $splitext/${splitext}.bam
#     bai=${bn}.hg38.final.bai
#     ln -s ${basedir}/${bai} $splitext/${bn}.bai
    cat <<- EOF > $splitext/${splitext}.data.config
#### REQUIRED ####
bam: $splitext/${splitext}.bam  # path to the alignments file (BAM/CRAM format)
fai: "/home/vfishman/soft/cue/data/demo/inputs/GRCh38.fa.fai"  # path to the reference FASTA FAI file
#### OPTIONAL ####
# chr_names: null  # list of chromosomes to process: null (all) or a specific list e.g. ["chr1", "chr21"]
logging_level: "INFO"  # verbosity level (set to "ERROR" to reduce logging volume)
EOF

    cat <<- EOF > $splitext/${splitext}.model.config
#### REQUIRED ####
model_path: "/home/vfishman/soft/cue/data/models/cue.v2.pt"  # path to the pretrained Cue model
n_cpus: 28
EOF

done