filter_feature_by_attribute_value.pl-脚本03

news2024/9/21 0:29:24

本脚本旨在根据属性值(第九列)过滤特征。

如果属性存在且值未通过测试,则该特征将被写入输出文件。

如果属性存在且值通过测试,则该特征将被丢弃并写入 `_discarded.gff` 文件。

如果属性标签缺失(无法应用测试),则该特征将默认写入输出文件。如果启用了 `--na_aside` 参数,则这些特征将被写入 `_na.gff` 文件。

属性存储在第九列,格式为:`tag=value`。  
/!\ 删除一级或二级特征将自动删除所有关联的子特征。  
/!\ 删除一个特征的所有子特征也会自动删除该特征本身(除非启用了 `--keep_parental`)。  
/!\ 如果 `--keep_parental` 未启用且 `--na_aside` 已启用,并且记录的所有三级特征在 `_na.gff` 和 `_discarded.gff` 之间被拆分,则父级的一、二级特征将被删除,并最终只保留在 `_na.gff` 文件中。

1 使用方法
agat_sp_filter_feature_by_attribute_value.pl --gff infile.gff --value 1 -t "=" [ --output outfile ]
agat_sp_filter_feature_by_attribute_value.pl --help
2 选项
-f, --reffile, --gff or -ref  
  输入的 GFF3 文件。

-a or --attribute
  指定要分析的属性标签(例如:`tag=value`)。

-p, --type or -l 
  主标签选项,不区分大小写,可接受列表。允许指定要处理的特征类型。可以通过第 3 列中的主标签名称指定特定特征,如:`cds`、`Gene`、`MrNa`。也可以直接指定特定级别的所有特征,如:`level2=mRNA,ncRNA,tRNA`,`level3=CDS,exon,UTR` 等。默认情况下,所有特征都会被考虑。填写 `all` 具有相同的效果。

--value  
  检查属性中的值,区分大小写。多个值须用逗号分隔。

--value_insensitive  
  布尔值,默认关闭。启用时,通过 `--value` 参数提供的值将不区分大小写进行处理。

--na_aside  
  布尔值,默认关闭。默认情况下,如果缺少用于过滤的属性标签,则该特征会写入输出文件。启用后,这些特征将被写入一个名为 `_na.gff` 的单独文件中。

--keep_parental
  布尔值,默认关闭。启用时,即使所有子特征已被删除,父级特征也会保留。

-t or --test  
  应用的测试(> < = ! >= <=),默认值为 `=`。如果使用 `>` 或 `<`,请记得对参数加引号,如 `"<="`,否则终端可能会出错。仅 `=` 和 `!` 可以用于比较字符串值。

-o or --output  
  输出 GFF 文件。如果未指定输出文件,结果将写入标准输出(STDOUT)。

-v  
  调试用途的详细输出选项。

-c or --config  
  字符串 - 输入 AGAT 配置文件。默认情况下,AGAT 会使用当前工作目录下的 `agat_config.yaml` 文件(如果存在),否则使用 AGAT 自带的原始配置文件。要在本地获取配置文件,请运行 `"agat config --expose"`。使用 `--config` 选项可以指定使用自定义的 AGAT 配置文件(位于其他位置或不同名称)。

-h or --help  
  显示此帮助文本。
3 脚本内容
#!/usr/bin/env perl

use strict;
use warnings;
use Getopt::Long;
use File::Basename;
use POSIX qw(strftime);
use Scalar::Util qw(looks_like_number);
use Pod::Usage;
use IO::File;
use AGAT::AGAT;

my $header = get_agat_header();
my $config;
my $primaryTag=undef;
my $opt_output= undef;
my $opt_value = undef;
my $opt_keep_parental = undef;
my $opt_na_aside = undef;
my $opt_value_insensitive = undef;
my $opt_attribute = undef;
my $opt_test = "=";
my $opt_gff = undef;
my $opt_verbose = undef;
my $opt_help;

# OPTION MANAGMENT
my @copyARGV=@ARGV;
if ( !GetOptions( 'f|ref|reffile|gff=s' => \$opt_gff,
                  'value=s'             => \$opt_value,
                  'value_insensitive!'  => \$opt_value_insensitive,
                  'keep_parental!'      => \$opt_keep_parental,
                  'na_aside!'           => \$opt_na_aside, 
                  "p|type|l=s"          => \$primaryTag,
                  'a|attribute=s'       => \$opt_attribute,
                  't|test=s'            => \$opt_test,
                  'o|output=s'          => \$opt_output,
                  'v|verbose!'          => \$opt_verbose,
                  'c|config=s'          => \$config,
                  'h|help!'             => \$opt_help ) )
{
    pod2usage( { -message => 'Failed to parse command line',
                 -verbose => 1,
                 -exitval => 1 } );
}

if ($opt_help) {
    pod2usage( { -verbose => 99,
                 -exitval => 0,
                 -message => "$header\n" } );
}

if ( ! $opt_gff or ! defined($opt_value) or ! $opt_attribute ){
    pod2usage( {
           -message => "$header\nAt least 3 parameters are mandatory:\n1) Input reference gff file: --gff\n".
           "2) An attribute tag: -a\n3) A value (string or int) that will be used for filtering: --value\n\n",
           -verbose => 0,
           -exitval => 2 } );
}

# --- Manage config ---
$config = get_agat_config({config_file_in => $config});

###############
# Test options
if($opt_test ne "<" and $opt_test ne ">" and $opt_test ne "<=" and $opt_test ne ">=" and $opt_test ne "=" and $opt_test ne "!"){
  print "The test to apply is Wrong: $opt_test.\nWe want something among this list: <,>,<=,>=,! or =.";exit;
}

###############
# Manage Output

## FOR GFF FILE
my $gffout_ok_file ;
my $fhout_discarded_file ;
my $ostreamReport_file;
my $fhout_semidDiscarded_file if $opt_na_aside;

if ($opt_output) {
  my ($outfile,$path,$ext) = fileparse($opt_output,qr/\.[^.]*/);

  # set file names
  $gffout_ok_file = $path.$outfile.$ext;
  $fhout_discarded_file = $path.$outfile."_discarded.gff";
  $ostreamReport_file = $path.$outfile."_report.txt";
  $fhout_semidDiscarded_file = $path.$outfile."_na.gff";
}

my $gffout_ok = prepare_gffout($config, $gffout_ok_file);
my $fhout_discarded = prepare_gffout($config, $fhout_discarded_file);
my $ostreamReport = prepare_fileout($ostreamReport_file);
my $fhout_semidDiscarded = prepare_gffout($config, $fhout_semidDiscarded_file) if $opt_na_aside;

# Manage $primaryTag
my @ptagList;
my $print_feature_string;
if(! $primaryTag or $primaryTag eq "all"){
  $print_feature_string = "all features";
  push(@ptagList, "all");
}
elsif($primaryTag =~/^level[123]$/){
  $print_feature_string .= "$primaryTag features ";
  push(@ptagList, $primaryTag);
}
else{
   @ptagList= split(/,/, $primaryTag);
   foreach my $tag (@ptagList){
      if($tag =~/^level[123]$/){
        $print_feature_string .= "$primaryTag features ";
      }
      else{
        $print_feature_string .= "$tag feature ";
      }
   }
}

# Transform value list into hash
my $value_hash = string_sep_to_hash({ string => $opt_value,
                                      separator => ","
                                    });
                                      
foreach my $value (keys %{$value_hash}){
  if( ! looks_like_number($value) ){
    if($opt_test ne "=" and $opt_test ne "!"){
      print "This test $opt_test is not possible with string value.\n";
      exit; 
    }
  }
}

# start with some interesting information
my $stringPrint = strftime "%m/%d/%Y at %Hh%Mm%Ss", localtime;
$stringPrint .= "\nusage: $0 @copyARGV\n";
$stringPrint .= "We will discard $print_feature_string that have the attribute $opt_attribute with the value $opt_test $opt_value";
if ($opt_value_insensitive){
  $stringPrint .= " case insensitive.\n";
}else{
   $stringPrint .= " case sensitive.\n";
}

if ($opt_output){
  print $ostreamReport $stringPrint;
  print $stringPrint;
}
else{ print $stringPrint; }
                          #######################
# >>>>>>>>>>>>>>>>>>>>>>>>#        MAIN         #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          #######################
my %all_cases = ( 'left' => {'l1' => 0, 'l2' => 0, 'l3' => 0, 'all' => 0},
                  'discarded' => {'l1' => 0, 'l2' => 0, 'l3' => 0, 'all' => 0} );

######################
### Parse GFF input #
my ($hash_omniscient, $hash_mRNAGeneLink) =  slurp_gff3_file_JD({ input => $opt_gff,
                                                                  config => $config
                                                                });
print("Parsing Finished\n");
### END Parse GFF input #
#########################
# sort by seq id
my $hash_sortBySeq = gather_and_sort_l1_by_seq_id($hash_omniscient);

my $removeit=undef;
#################
# == LEVEL 1 == #
#################
foreach my $seqid (sort { (($a =~ /(\d+)$/)[0] || 0) <=> (($b =~ /(\d+)$/)[0] || 0) } keys %{$hash_sortBySeq}){ # loop over all the feature level1

	foreach my $tag_l1 (sort {$a cmp $b} keys %{$hash_omniscient->{'level1'}}){
		foreach my $feature_l1 ( @{$hash_sortBySeq->{$seqid}{$tag_l1}} ){
			my $id_l1 = lc($feature_l1->_tag_value('ID'));

	    $removeit = check_feature($feature_l1, 'level1');
			# we can remove feature L1 now because we are looping over $hash_sortBySeq not $hash_omniscient
	    if ($removeit){
        my $cases;
        if($removeit == 1){ 
          $cases = remove_l1_and_relatives($hash_omniscient, $feature_l1, $fhout_discarded);
          $all_cases{'discarded'}{'l1'} += $cases->{'l1'};
          $all_cases{'discarded'}{'l2'} += $cases->{'l2'};
          $all_cases{'discarded'}{'l3'} += $cases->{'l3'};
          $all_cases{'discarded'}{'all'} += $cases->{'all'};
        } elsif ($removeit == 2 and $opt_na_aside){ 
          $cases = remove_l1_and_relatives($hash_omniscient, $feature_l1, $fhout_semidDiscarded);
          $all_cases{'na'}{'l1'} += $cases->{'l1'};
          $all_cases{'na'}{'l2'} += $cases->{'l2'};
          $all_cases{'na'}{'l3'} += $cases->{'l3'};
          $all_cases{'na'}{'all'} += $cases->{'all'};
        }
				next;
	    }

	    #################
	    # == LEVEL 2 == #
	    #################
			my %list_l2_to_remove;
			my %list_l3_to_remove;
	    foreach my $tag_l2 (sort keys %{$hash_omniscient->{'level2'}}){ # primary_tag_key_level2 = mrna or mirna or ncrna or trna etc...

	      if ( exists_keys( $hash_omniscient, ('level2', $tag_l2, $id_l1) ) ){
	        my @list_fl2 = @{$hash_omniscient->{'level2'}{$tag_l2}{$id_l1}};
	        foreach my $feature_l2 ( @list_fl2 ) {

	          $removeit = check_feature($feature_l2,'level2');
	          if ($removeit){
              if ($removeit == 1){
                push ( @{$list_l2_to_remove{'discarded'}}, [$feature_l2, $tag_l1, $id_l1, $fhout_discarded]);
              } elsif ($removeit == 2 and $opt_na_aside){
                push ( @{$list_l2_to_remove{'na'}}, [$feature_l2, $tag_l1, $id_l1, $fhout_semidDiscarded]);
              }
	            next;
	          }
	          #################
	          # == LEVEL 3 == #
	          #################
	          my $id_l2 = lc($feature_l2->_tag_value('ID'));

	          foreach my $tag_l3 (sort keys %{$hash_omniscient->{'level3'}}){ # primary_tag_key_level3 = cds or exon or start_codon or utr etc...
	            if ( exists_keys( $hash_omniscient, ('level3', $tag_l3, $id_l2) ) ){
	              my @list_fl3 = @{$hash_omniscient->{'level3'}{$tag_l3}{$id_l2}};
	              foreach my $feature_l3 ( @list_fl3 ) {

	                $removeit = check_feature($feature_l3, 'level3');
                  if($removeit ==  1){
                    push ( @{$list_l3_to_remove{'discarded'}}, [$feature_l3, $tag_l1, $id_l1, $tag_l2, $id_l2, $fhout_discarded]); 
                  } elsif ( $removeit == 2 and $opt_na_aside ){
                    push ( @{$list_l3_to_remove{'na'}}, [$feature_l3, $tag_l1, $id_l1, $tag_l2, $id_l2, $fhout_semidDiscarded]);
	                }
	              }
	            }
	          }
	        }
	      }
	    }
			# Should be removed after looping over them to avoid problems
			foreach my $key ( keys %list_l2_to_remove ){
				foreach my $infos ( @{$list_l2_to_remove{$key}} ) {
					my $cases = remove_l2_and_relatives( $hash_omniscient, @$infos, $opt_keep_parental);
					$all_cases{$key}{'l1'} += $cases->{'l1'};
					$all_cases{$key}{'l2'} += $cases->{'l2'};
					$all_cases{$key}{'l3'} += $cases->{'l3'};
					$all_cases{$key}{'all'} += $cases->{'all'};
				}
			}
			foreach my $key ( sort keys %list_l3_to_remove ){
				foreach my $infos ( @{$list_l3_to_remove{$key}} ) {
					my $cases = remove_l3_and_relatives( $hash_omniscient, @$infos, $opt_keep_parental);
					$all_cases{$key}{'l1'} += $cases->{'l1'};
					$all_cases{$key}{'l2'} += $cases->{'l2'};
					$all_cases{$key}{'l3'} += $cases->{'l3'};
					$all_cases{$key}{'all'} += $cases->{'all'};
				}
			}
		}
  }
}

print_omniscient( {omniscient => $hash_omniscient, output => $gffout_ok} );

$stringPrint = "Feature discarded by applying the test (see $fhout_discarded_file file):\n";
$stringPrint .= $all_cases{'discarded'}{'all'}." features removed:\n";
$stringPrint .= $all_cases{'discarded'}{'l1'}." features level1 (e.g. gene) removed\n";
$stringPrint .= $all_cases{'discarded'}{'l2'}." features level2 (e.g. mRNA) removed\n";
$stringPrint .= $all_cases{'discarded'}{'l3'}." features level3 (e.g. exon) removed\n";

if($opt_na_aside){
  $stringPrint .= "Feature left out because the attribute is missing (see $fhout_semidDiscarded_file file):\n";
  $stringPrint .= $all_cases{'na'}{'all'}." features removed:\n";
  $stringPrint .= $all_cases{'na'}{'l1'}." features level1 (e.g. gene) removed\n";
  $stringPrint .= $all_cases{'na'}{'l2'}." features level2 (e.g. mRNA) removed\n";
  $stringPrint .= $all_cases{'na'}{'l3'}." features level3 (e.g. exon) removed\n";
}

if ($opt_output){
  print $ostreamReport $stringPrint;
  print $stringPrint;
} else{ print $stringPrint; }

#######################################################################################################################
        ####################
         #     methods    #
          ################
           ##############
            ############
             ##########
              ########
               ######
                ####
                 ##

sub check_feature{
  my  ($feature, $level)=@_;

  my $removeit=undef;
  my $primary_tag=$feature->primary_tag;

  # check primary tag (feature type) to handle
  foreach my $ptag (@ptagList){

    if($ptag eq "all"){
      $removeit = should_we_remove_feature($feature);
    }
    elsif(lc($ptag) eq $level){
      $removeit = should_we_remove_feature($feature);
    }
    elsif(lc($ptag) eq lc($primary_tag) ){
      $removeit = should_we_remove_feature($feature);
    }
  }
  return $removeit;
}

sub should_we_remove_feature{
  my ($feature)=@_;

  if ($feature->has_tag($opt_attribute)){

    # get list of values for the attribute
    my @file_values = $feature->get_tag_values($opt_attribute);

    # if we found among the values one pass the test we return 1
    foreach my $file_value (@file_values){

      foreach my $given_value (keys %{$value_hash}){
        # Deal with insensitive for template
        if ($opt_value_insensitive){
          $given_value = lc($given_value);
          $file_value = lc($file_value);
        }
        # for string values replace = by eq and ! by ne and avoid other type of test
        if ( ! looks_like_number ($given_value) or ! looks_like_number ($file_value)){
          print "String case\n" if $opt_verbose;
          if ($opt_test eq "="){
            if ($file_value eq $given_value) { print "equal\n" if $opt_verbose; return 1; }
            else { print "not equal\n" if $opt_verbose; }
          }
          elsif ($opt_test eq "!"){
            if ($file_value ne $given_value){ print "different\n" if $opt_verbose; return 1; }
            else { print "not different\n" if $opt_verbose; }
          }
        } 
        else{
          print "Number case\n" if $opt_verbose;
          if ($opt_test eq "="){
            if ($file_value == $given_value){return 1; }
          }
          elsif ($opt_test eq "!"){
            if ($file_value != $given_value){return 1; }
          }
          elsif ($opt_test eq ">"){
            if ($file_value > $given_value){return 1; }
          }
          elsif ($opt_test eq "<"){
            if ($file_value < $given_value){return 1; }
          }
          elsif ($opt_test eq "<="){
            if ($file_value <= $given_value){return 1; }
          }
          elsif ($opt_test eq ">="){
            if ($file_value >= $given_value){return 1; }
          }
        }
      }
    }
    return 0;
  } else {
    print "Attribute not found  case\n" if $opt_verbose;
    return 2;
  }
}

__END__

=head1 NAME

agat_sp_filter_feature_by_attribute_value.pl

=head1 DESCRIPTION

The script aims to filter features according to attribute value (9th column).
- If the attribute exists and the value do not pass the test, the feature is written into <output>.
- If the attribute exists and the value pass the test, the feature is discarded and written into <output>_discarded.gff.
- If the attribute tag is missing (test cannot be applyed), the feature will be written into <output> by default. If --na_aside parameter 
is activated then it will be written into <output>_na.gff.

Attribute are stored in the 9th column and have this shape: tag=value
/!\ Removing a level1 or level2 feature will automatically remove all linked subfeatures.
/!\ Removing all children of a feature will automatically remove this feature too (excepted if --keep_parental is activated).
/!\ If --keep_parental is not activated and --na_aside is activated, and all level3 features of a record are split between both <output>_na.gff and <output>_discarded.gff, 
then the parental level1 and level2 features are removed and will end up in the <output>_na.gff file only.

=head1 SYNOPSIS

    agat_sp_filter_feature_by_attribute_value.pl --gff infile.gff --value 1 -t "=" [ --output outfile ]
    agat_sp_filter_feature_by_attribute_value.pl --help

=head1 OPTIONS

=over 8

=item B<-f>, B<--reffile>, B<--gff>  or B<-ref>

Input GFF3 file that will be read

=item  B<-a> or B<--attribute>

Attribute tag to specify the attribute to analyse (attribute example: tag=value).

=item B<-p>,  B<--type> or  B<-l>

primary tag option, case insensitive, list. Allow to specied the feature types that will be handled.
You can specified a specific feature by given its primary tag name (column 3) as: cds, Gene, MrNa
You can specify directly all the feature of a particular level:
      level2=mRNA,ncRNA,tRNA,etc
      level3=CDS,exon,UTR,etc
By default all feature are taking into account. fill the option by the value "all" will have the same behaviour.

=item B<--value>

Value(s) to check in the attribute. Case sensitive. List of values must be coma separated.

=item B<--value_insensitive>

Bolean. Deactivated by default. When activated the values provided by the --value parameter are handled case insensitive.

=item B<--na_aside>

Bolean. Deactivated by default. By default if the attribute tag on which the filter is based is missing, the feature will be written into <output>.
When activated, such features will be written into a separate file called <output>_na.gff.

=item B<--keep_parental>

Bolean. Deactivated by default. When activated even if all child features have been removed, the parental one will be kept.

=item B<-t> or B<--test>

Test to apply (> < = ! >= <=). default value "=". 
If you use one of these two character >, <, please don't forget to quote the
parameter like that "<=" otherwise your terminal will complain.
Only = and ! tests can be used to compare string values.

=item B<-o> or B<--output>

Output GFF file. If no output file is specified, the output will be
written to STDOUT.

=item B<-v>

Verbose option for debugging purpose.

=item B<-c> or B<--config>

String - Input agat config file. By default AGAT takes as input agat_config.yaml file from the working directory if any, 
otherwise it takes the orignal agat_config.yaml shipped with AGAT. To get the agat_config.yaml locally type: "agat config --expose".
The --config option gives you the possibility to use your own AGAT config file (located elsewhere or named differently).

=item B<-h> or B<--help>

Display this helpful text.

=back

=head1 FEEDBACK

=head2 Did you find a bug?

Do not hesitate to report bugs to help us keep track of the bugs and their
resolution. Please use the GitHub issue tracking system available at this
address:

            https://github.com/NBISweden/AGAT/issues

 Ensure that the bug was not already reported by searching under Issues.
 If you're unable to find an (open) issue addressing the problem, open a new one.
 Try as much as possible to include in the issue when relevant:
 - a clear description,
 - as much relevant information as possible,
 - the command used,
 - a data sample,
 - an explanation of the expected behaviour that is not occurring.

=head2 Do you want to contribute?

You are very welcome, visit this address for the Contributing guidelines:
https://github.com/NBISweden/AGAT/blob/master/CONTRIBUTING.md

=cut

AUTHOR - Jacques Dainat

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2150579.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Qt笔记】QToolBox控件详解

目录 引言 一、QToolBox的基本功能 1.1 分页布局 1.2 可点击标签 1.3 图标支持 1.4 信号与槽 二、 QToolBox的属性设置 2.1 设置指定索引位置可用性 2.2 设置指定索引位置图标 2.3 设置标题 2.4 设置提示信息 2.5 获取信息 三、QToolBox的常用API 3.1 构造函数…

前端vue-单选按钮的实现

要把name“sex”和value"男" 和 要把name“sex”和value"女"写上&#xff0c;然后在各自的标签内部写上v-model绑定属性。data中定义v-model的绑定值&#xff0c;后面的值是默认选中的男或者女性。

Google Play金融类应用上了又被下,怎么搞定设备短信权限问题?

不久前谷歌对金融类产品应用更新了政策要求&#xff0c;即8月31日起新注册的开发者账号必须得注册为企业账号才可以上架金融类产品应用&#xff0c;这对原本就是用企业号的开发团队或公司没什么影响&#xff0c;但如果用的是个人号得做点准备了。 可以看出&#xff0c;谷歌对金…

剑灵服务端源码(c#版本+数据库+配套客户端+服务端)

剑灵服务端源码&#xff0c;喜欢的下载研究研究。谁技术牛B的话&#xff0c;能把最新版本的客户端接上&#xff0c;就好了。 剑灵服务端源码&#xff08;c#版本数据库配套客户端服务端&#xff09; 下载地址&#xff1a; 通过网盘分享的文件&#xff1a;【源码】剑灵服务端源码…

利士策分享,自我和解:通往赚钱与内心富足的和谐之道

利士策分享&#xff0c;自我和解&#xff1a;通往赚钱与内心富足的和谐之道 在这个快节奏、高压力的时代&#xff0c;我们往往在追求物质财富的同时&#xff0c;忽略了内心世界的和谐与平衡。 赚钱&#xff0c;作为现代生活中不可或缺的一部分&#xff0c;它不仅仅是生存的手段…

YOLOv8改进 - 注意力篇 - 引入ECA注意力机制

一、本文介绍 作为入门性第一篇&#xff0c;这里介绍了ECA注意力在YOLOv8中的使用。包含ECA原理分析&#xff0c;ECA的代码、ECA的使用方法、以及添加以后的yaml文件及运行记录。 二、ECA原理分析 ECA官方论文地址&#xff1a;ECA文章 ECA的pytorch版代码&#xff1a;ECA的…

C++第十一节课 new和delete

一、new和delete操作自定义类型 new/delete 和 malloc/free最大区别是 new/delete对于【自定义类型】除了开空间还会调用构造函数和析构函数&#xff08;new会自动调用构造函数&#xff1b;delete会调用析构函数&#xff09; class A { public:A(int a 0): _a(a){cout <&l…

systemd学习

传统init进程启动流程 kernel内核代码init/main.c&#xff0c;内核启动init进程过程&#xff1a; init进程是由内核启动的第一个&#xff08;也是唯一的一个&#xff09;用户进程&#xff08;进程id为1&#xff09;&#xff0c;它根据配置文件决定启动哪些程序&#xff0c;ini…

mybatisplus的多记录操作 批量删除和批量查询

1.批量查询 通过in查询 Testpublic void testBatchSelectByIds(){List<Integer> ids Arrays.asList(5,7);List<User> users userMapper.selectBatchIds(ids);log.info(users);} 2.批量删除 Testpublic void testBatchDelete(){List<Integer> ids Arrays…

LLM - 理解 多模态大语言模型(MLLM) 的 指令微调(Instruction-Tuning) 与相关技术 (四)

欢迎关注我的CSDN&#xff1a;https://spike.blog.csdn.net/ 本文地址&#xff1a;https://spike.blog.csdn.net/article/details/142237871 免责声明&#xff1a;本文来源于个人知识与公开资料&#xff0c;仅用于学术交流&#xff0c;欢迎讨论&#xff0c;不支持转载。 完备(F…

Java知识点小结3:内存回收

文章目录 对象引用强引用软引用&#xff08;SoftReference&#xff09;弱引用&#xff08;WeakReference&#xff09;考一考 虚引用&#xff08;PhantomReference&#xff09;总结 垃圾回收新生代老年代永生代 内存管理小技巧尽量使用直接量使用StringBuilder和StringBuffer进行…

Vue学习记录之六(组件实战及BEM框架了解)

一、BEM BEM是一种前端开发中常用的命名约定&#xff0c;主要用于CSS和HTML的结构化和模块化。BEM是Block、Element、Modifier的缩写。 Block&#xff08;块&#xff09;&#xff1a;独立的功能性页面组件&#xff0c;可以是一个简单的按钮&#xff0c;一个复杂的导航条&…

A Simple Encoder-Decoder for Open-Vocabulary Semantic Segmentation

FAM: Feature Aggregation Module&#xff0c;Circle with R represents removing feature maps of non-selected categories 辅助信息 权重有1.3G&#xff0c;不建议复现

neo4j关系的创建删除 图的删除

关系的创建和删除 关系创建 CREATE (:Person {name:"jack"})-[:LOVE]->(:Person {name:"Rose"})已有这个关系时&#xff0c;merge不起效果 MERGE (:Person {name:"Jack" })-[:LOVE]->(:Person {name:"Rose"})关系兼顾节点和关…

功耗中30分钟下载场景对平均电流标准的影响评估

下载场景的测试数据: 测试结论:相同场景下,有应用下载安装跟没应用下载安装,平均电流相差90-140mA左右 查看数据:下载场景的平均增量电流 (227+279) / 2 - 136 = 117 mA 理论的量化数据影响 根据当前的测试数据:静置待机平均电流 136 mA,下载场景平均电流增量 117mA, …

相亲交易系统源码详解与开发指南

随着互联网技术的发展&#xff0c;越来越多的传统行业开始寻求线上转型&#xff0c;其中就包括婚恋服务。传统的相亲方式已经不能满足现代人快节奏的生活需求&#xff0c;因此&#xff0c;开发一款基于Web的相亲交易系统显得尤为重要开发者h17711347205。本文将详细介绍如何使用…

电气自动化入门05:三相异步电动机的正反转点动控制电路

视频链接&#xff1a;3.2 电工知识&#xff1a;三相异步电动机的正反转点动控制电路_1_哔哩哔哩_bilibilihttps://www.bilibili.com/video/BV1PJ41117PW?p6&vd_sourceb5775c3a4ea16a5306db9c7c1c1486b5 1.断路器及其选型 1.1断路器定义、分类、表示符号 1.2.断路器功能、…

Vision Transform—用于大规模图像分类的Transformers架构

VIT — 用于大规模图像识别的 Transformer 论文题目&#xff1a;AN IMAGE IS WORTH 16X16 WORDS:TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE。 官方代码&#xff1a;https://github.com/google-research/vision_transformer 引言与概述 Vision Transformer&#xff08;ViT&…

虚拟机vaware中cpu设置跑满大核

首先&#xff0c;大核速度快&#xff0c;并且在资源紧张时大核优先&#xff0c;小核甚至是闲着围观大核跑满。其次&#xff0c;遇到经常切换操作虚拟机和win11的使用场景&#xff0c;切换核心本身也会造成一点卡顿&#xff0c;降低虚拟机里操作流畅度。另外&#xff0c;13代在你…

【linux】4张卡,坏了1张,怎么办?

先禁用这张卡 grub 禁用&#xff0c;防止加载驱动 禁用这张卡的 PCI # 禁用 PCI 设备 0000:b1:00.0 (NVIDIA GPU) ACTION"add", SUBSYSTEM"pci", ATTR{vendor}"0x10de", KERNELS"0000:b1:00.0", RUN"/bin/sh -c echo 0000:b1:00…