Skip to content

When running the SWARM_read_level.py script with the --modsam parameter, there is no output. #5

Open

Description

@wangguiqian

Hi Stefan,
The script command I ran:

python3 /public/home/gqwang/Software/SWARM/SWARM_scripts/SWARM_read_level.py
-m m6A
--sam /public/home/gqwang/Workplate_data/Swarm/Swarm_Reverse/sx-50h_Reverse_eventalign.sam
--fasta /public/home/gqwang/Workplate_data/Cheui/ASFV_HLJ_rev.fa
--raw /public/home/gqwang/Workplate_data/Swarm/sx-50h.blow5
--out /public/home/gqwang/Workplate_data/Swarm/Swarm_Reverse/sx-50h_m6A-Reverse_TEST
--kit RNA002
--modsam
--threads 4

When I add the --modsam parameter, the .mod.sam file doesn't output any results, and Python keeps running in an empty loop. This might be a problem with the predict_model1_parallel_modsam.py script.

Best,
Kevin

Activity

  1. stefanprodic commented on Mar 4, 2026

    @stefanprodic
    Contributor

    Hi Kevin,

    Thanks for flagging this! Current --modsam implementation can run only on 1 thread. I am updating the code to fix threads arg for modsam mode until future implementations.

    Thanks,
    Stefan

  2. stefanprodic commented on Mar 4, 2026

    @stefanprodic
    Contributor

    Hi Kevin,

    Please let me know if --modsam works on your side with --nworkers 1 which is fixed for --modsam mode in the latest SWARM update.

    Thanks,
    Stefan

  3. wangguiqian commented on Mar 4, 2026

    @wangguiqian
    Author

    Hi Kevin,

    Please let me know if --modsam works on your side with --nworkers 1 which is fixed for --modsam mode in the latest SWARM update.

    Thanks, Stefan
    Hi Stefan,

    I will retest your modified script later. Thank you for your work. I have another question: why did I find that the m5C modification sites I detected using CHEUI (https://github.com/comprna/CHEUI) were mainly distributed at GC sites, but the m5C methylation site analysis using SWARM showed completely different sites? The site information is as follows:

    Image

    Will using SWARM for m5C methylation analysis affect my research on viral mRNA transcription? What are the differences between CHEUI and SWARM? Or were there any optimizations made, and which software is more accurate for methylation analysis?

  4. wangguiqian commented on Mar 5, 2026

    @wangguiqian
    Author

    Hi Kevin,

    Please let me know if --modsam works on your side with --nworkers 1 which is fixed for --modsam mode in the latest SWARM update.

    Thanks, Stefan
    Hi Stefan,
    I re-ran your modified SWARM_read_level.py script, but I found that it still couldn't output anything correctly. I'm also trying to troubleshoot the issue with your script again.

    Image Please see the output of the .mod.sam file: (swarm) [gqwang@mn02 ASFV_bam]$ cat sx-50h_m5C_Forward.mod.sam

    @hd VN:1.6 SO:coordinate
    @sq SN:ASFV_HLJ LN:189404
    @pg ID:minimap2 PN:minimap2 VN:2.23-r1111 CL:minimap2 -ax map-ont -k 14 -t 18 /public/home/gqwang/Workplate_data/Cheui/Virus_For.fa /public/home/gqwang/Workplate_data/Swarm/sx-24h.fq
    @pg ID:samtools PN:samtools PP:minimap2 VN:1.17 CL:samtools sort -o sx-24h_total.sorted.bam
    @pg ID:samtools.1 PN:samtools PP:samtools VN:1.17 CL:samtools view -b -F 2324 sx-24h_total.sorted.bam

    Please see the command:
    (swarm) [gqwang@mn02 ASFV_bam]$ cat run_get-modsam.sh
    module purge
    module load cuda/12.2.0
    module load cudnn/8.9.7_cuda12
    module load GCC/9.4.0
    module load minimap2/2.23
    module load SAMtools/1.17

    python /public/home/gqwang/Software/SWARM/SWARM_scripts/SWARM_read_level.py -m m6A --sam sx-24h_Forward_eventalign.sam --fasta /public/home/gqwang/Workplate_data/Cheui/Virus_For.fa --raw ../sx-24h.blow5 --out sx-24h_m6A_Forward --kit RNA002 --threads 18 --modsam --temp ./

    The strange thing is that it keeps running, but the CPU isn't being used; it's like it's running in an infinite loop, but the CPU isn't actually running.
    Best,
    Kevin

  5. wangguiqian commented on Mar 5, 2026

    @wangguiqian
    Author

    Hi Kevin,

    Please let me know if --modsam works on your side with --nworkers 1 which is fixed for --modsam mode in the latest SWARM update.

    Thanks, Stefan

    Hi Stefan,
    Now that I've located the methylation site, how do I go back and find the original Fastq sequence ID of that methylation site? I want to statistically analyze the differences in PolyA tail length between methylated and unmethylated reads.

    Best,
    Kevin

  6. stefanprodic commented on Mar 16, 2026

    @stefanprodic
    Contributor

    Hi Kevin,

    Have you tried using --nworkers 1 on your side? If it is still not running as expected please upload the input files and I can try to reproduce the issue.

    For the second question, you can find the readID of each fastq entry in read-level predictions. These are 3 column tsv files in following format:

    1. Base metadata: refContig_refPosition_9merSeq_readID_readPosition_qscore_calledBase

    2. Molecule-level probability, between 0 and 1. Target modification should have higher probability.

    3. Model code, used for selecting parameters for site-level prediction.

    Best,
    Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions