You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Copy the `targets_with_chr.bed` and `GC_G1000_on_target_hg38.txt` files into the newly created `battenberg_loci_on_target_hg38` folder before running the next set of steps. ASCAT generates a list of GC correction loci with sufficient coverage in a sample, then intersects that with the list of all loci with tumour logR values in that sample. If the intersection is <10% the size of the latter, it will fail with an error. Because the Battenberg loci/allele sets are very dense, subsetting to on-target regions is still too many loci. This script ensures that all SNPs with GC correction information are included in the loci list, plus a random sample of another 30% of all on target loci. You may need to vary this proportion depending on your set of targets. A good rule of thumb is that the size of your GC correction loci list should be about 15% the size of your total loci list. This allows for a margin of error.
648
648
649
+
### 'chr'-based versus non 'chr'-based reference
650
+
651
+
Please note that loci files provided from ASCAT developers (https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WES) are not 'chr'-based (chromosome names are '1', '2', '3', etc. and not 'chr1', 'chr2', 'chr3', etc.). If your BAMs are 'chr'-based, you will need to add 'chr'
652
+
```bash
653
+
foriin {1..22} X;
654
+
do sed -i 's/^/chr/' G1000_loci_hg19_chr${i}.txt;
655
+
done).
656
+
```
657
+
658
+
ASCAT will internally remove 'chr' so the other files (allele, GC correction and RT correction) should not be modified and chrom_names (ascat.prepareHTS) should be c(1:22,'X').
659
+
660
+
If using ASCAT provided references:
661
+
```bash
662
+
663
+
cd .../G1000_lociAll_hg38_unzipped/G1000_lociAll_hg38
664
+
665
+
# Function to check and correct 'chr' prefix
666
+
check_and_correct_chr_prefix() {
667
+
local file=$1
668
+
local chr_number=$2
669
+
670
+
# Check if file exists
671
+
if [ !-f"$file" ];then
672
+
echo"Error: File $file not found."
673
+
exit 1
674
+
fi
675
+
676
+
# Check first line of the file
677
+
first_line=$(head -n 1 "$file")
678
+
679
+
if [[ $first_line== chr${chr_number}* ]];then
680
+
echo"File $file already has correct 'chr' prefix. No changes needed."
0 commit comments